Blockly.Blocks['identify_label_number'] = {
  init: function () {
    this.jsonInit({
      type: 'identify_label_number',
      message0: '%1 %{BKY_CAMERA}%{BKY_IDENTIFY_LABEL_NUMBER} %2',
      args0: [{ type: 'field_dropdown', name: 'camera', options: cameraOptions() }, artagIdOptions],
      output: 'Boolean',
      colour: Blockly.Msg.VisualHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['identify_label_number'] = undefined

Blockly.Python['identify_label_number'] = function (block) {
  const camera = block.getFieldValue('camera');
  const number = block.getFieldValue('number');
  const code = `${GET_SPECIFIES_TAG}(${number}, '${camera}')[${artagOptions.x.value}] != 1000`;
  return [code, Blockly.Python.ORDER_NONE];
}

Blockly.Blocks['Right_leg_move'] = {
  init: function () {
    this.jsonInit({
      type: 'Right_leg_move',
      message0: '%{BKY_RIGHT_LEG_MOVE}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Right_leg_move'] = function (block) {
  const code = [
    'MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)',
    'MOTOsetspeed(35)',
    'MOTOmove16(80, 30, 100, 100, 93, 56, 124, 100, 95, 112, 101, 100, 107, 145, 77, 101)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(35)',
    'MOTOmove16(101, 97, 101, 100, 93, 56, 124, 100, 95, 112, 101, 100, 107, 145, 77, 101)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(35)',
    'MOTOmove16(101, 97, 101, 100, 93, 56, 124, 100, 182, 112, 101, 100, 107, 145, 77, 101)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(35)',
    'MOTOmove16(12, 97, 101, 100, 93, 56, 124, 100, 182, 112, 101, 100, 107, 145, 77, 101)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(56)',
    'MOTOmove16(12, 97, 101, 100, 93, 56, 124, 100, 40, 112, 101, 100, 107, 145, 77, 101)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(56)',
    'MOTOmove16(163, 97, 101, 98, 93, 56, 124, 102, 40, 112, 101, 102, 107, 145, 76, 102)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(14)',
    'MOTOmove16(163, 97, 101, 97, 93, 55, 123, 104, 40, 112, 101, 107, 109, 152, 71, 115)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(60)',
    'MOTOmove16(165, 98, 10, 102, 93, 55, 123, 109, 40, 112, 190, 114, 91, 149, 60, 121)',
    'MOTOwait()',
    'MOTOsetspeed(60)',
    'MOTOmove16(163, 97, 101, 100, 93, 56, 124, 100, 40, 112, 101, 100, 107, 145, 77, 101)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(35)',
    'MOTOmove16(81, 31, 100, 100, 93, 56, 124, 100, 121, 170, 100, 100, 107, 146, 76, 101)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Right_leg_move'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['RIGHT_LEG_MOVE'] + "')\n";
  return code;
}

Blockly.Blocks['Right_foot_shot'] = {
  init: function () {
    this.jsonInit({
      type: 'Right_foot_shot',
      message0: '%{BKY_RIGHT_FOOT_SHOT}',
      previousStatement: null,
      nextStatement: null,
      colour: '#7148F5',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Right_foot_shot'] = function (block) {
  const code = [
    'MOTOrigid16(25,25,25,70,70,70,70,70,25,25,25,70,70,70,70,70)',
    'MOTOsetspeed(8)',
    'MOTOmove16(80, 40, 100, 108, 93, 55, 123, 111, 120, 160, 100, 114, 109, 152, 71, 115)',
    'MOTOwait()',
    'MOTOsetspeed(34)',
    'MOTOmove16(80, 40, 100, 105, 113, 55, 130, 114, 120, 160, 100, 114, 58, 88, 96, 117)',
    'MOTOwait()',
    'MOTOsetspeed(34)',
    'MOTOmove16(90, 37, 38, 107, 113, 68, 115, 114, 135, 161, 35, 123, 139, 84, 122, 104)',
    'MOTOwait()',
    'MOTOsetspeed(90)',
    'MOTOmove16(79, 39, 100, 105, 113, 64, 126, 114, 119, 161, 99, 123, 98, 105, 119, 112)',
    'MOTOwait()',
    'MOTOsetspeed(110)',
    'MOTOmove16(71, 23, 166, 105, 101, 57, 129, 113, 120, 160, 150, 123, 48, 153, 29, 104)',
    'MOTOwait()',
    'DelayMs(400)',
    'MOTOsetspeed(25)',
    'MOTOmove16(80, 40, 100, 105, 97, 55, 128, 112, 120, 160, 100, 123, 70, 122, 58, 117)',
    'MOTOwait()',
    'MOTOsetspeed(25)',
    'MOTOmove16(80, 40, 100, 105, 95, 55, 123, 113, 120, 160, 100, 123, 90, 119, 86, 120)',
    'MOTOwait()',
    'MOTOsetspeed(15)',
    'MOTOmove16(80, 40, 100, 107, 93, 55, 123, 110, 120, 160, 100, 113, 103, 127, 83, 122)',
    'MOTOwait()',
    'MOTOsetspeed(8)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Right_foot_shot'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['RIGHT_FOOT_SHOT'] + "')\n";
  return code;
}

Blockly.Blocks['1709278994618'] = {
  init: function() {
    this.jsonInit({
      "type": "1709278994618",
      "message0": "左倾斜",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709278994618'] = function(block) {
  let code = "MOTOrigid16(25,25,25,70,70,70,70,70,25,25,25,70,70,70,70,70)\nMOTOsetspeed(8)\nMOTOmove19(80,40,100,108,93,55,123,111,120,160,100,114,109,152,71,115,0,0,100)\nMOTOwait()\nMOTOsetspeed(34)\nMOTOmove19(80,40,100,105,113,55,130,114,120,160,100,114,58,88,96,117,128,71,100)\nMOTOwait()\nMOTOsetspeed(34)\nMOTOmove19(90,37,38,107,113,68,115,114,135,161,35,123,139,84,122,104,128,71,100)\nMOTOwait()\nMOTOsetspeed(90)\nMOTOmove19(79,39,100,105,113,64,126,114,119,161,99,123,98,105,119,112,128,71,100)\nMOTOwait()\nMOTOsetspeed(110)\nMOTOmove19(71,23,166,105,101,57,129,113,120,160,150,123,48,153,29,104,128,71,100)\nMOTOwait()\nDelayMs(400)\nMOTOsetspeed(25)\nMOTOmove19(80,40,100,105,97,55,128,112,120,160,100,123,70,122,58,117,128,71,100)\nMOTOwait()\nMOTOsetspeed(25)\nMOTOmove19(80,40,100,105,95,55,123,113,120,160,100,123,90,119,86,120,128,71,100)\nMOTOwait()\nMOTOsetspeed(15)\nMOTOmove19(80,40,100,107,93,55,123,110,120,160,100,113,103,127,83,122,128,71,100)\nMOTOwait()\nMOTOsetspeed(8)\nMOTOmove19(80,30,100,100,93,55,124,100,120,170,100,100,107,145,76,100,128,71,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709278994618'] = function(block) {
  let code = "base_action.action('左倾斜')\n";
  return code;
}

Blockly.Blocks['1709279106914'] = {
  init: function() {
    this.jsonInit({
      "type": "1709279106914",
      "message0": "右腿跨步",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709279106914'] = function(block) {
  let code = "MOTOrigid16(25,25,25,70,70,70,70,70,25,25,25,70,70,70,70,70)\nMOTOsetspeed(8)\nMOTOmove19(80,40,100,108,93,55,123,111,120,160,100,114,109,152,71,115,0,0,100)\nMOTOwait()\nMOTOsetspeed(34)\nMOTOmove19(80,40,100,105,113,55,130,114,120,160,100,114,58,88,96,117,128,71,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709279106914'] = function(block) {
  let code = "base_action.action('右腿跨步')\n";
  return code;
}

Blockly.Blocks['Stretch_arm'] = {
  init: function () {
    this.jsonInit({
      type: 'Stretch_arm',
      message0: '%{BKY_STRETCH_ARM}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Stretch_arm'] = function (block) {
  const code = [
    'MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)',
    'MOTOsetspeed(35)',
    'MOTOmove16(80, 30, 100, 94, 105, 63, 124, 93, 120, 170, 100, 106, 95, 137, 76, 107)',
    'MOTOwait()',
    'MOTOsetspeed(35)',
    'MOTOmove16(81, 21, 188, 100, 93, 55, 124, 100, 119, 169, 99, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(35)',
    'MOTOmove16(82, 18, 187, 100, 93, 55, 124, 100, 119, 183, 13, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(35)',
    'MOTOmove16(82, 100, 187, 100, 93, 55, 124, 100, 119, 183, 13, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(35)',
    'MOTOmove16(82, 100, 187, 100, 93, 55, 124, 100, 118, 100, 13, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(35)',
    'MOTOmove16(22, 39, 187, 100, 93, 55, 124, 100, 178, 161, 13, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(35)',
    'MOTOmove16(100, 100, 100, 100, 93, 55, 124, 100, 100, 100, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'DelayMs(200)',
    'MOTOsetspeed(35)',
    'MOTOmove16(50, 190, 100, 100, 93, 55, 124, 100, 150, 10, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'DelayMs(200)',
    'MOTOsetspeed(35)',
    'MOTOmove16(100, 100, 100, 100, 93, 55, 124, 100, 100, 100, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'DelayMs(300)',
    'MOTOsetspeed(35)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Stretch_arm'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['STRETCH_ARM'] + "')\n";
  return code;
}

Blockly.Blocks['Right_hand_up'] = {
  init: function () {
    this.jsonInit({
      type: 'Right_hand_up',
      message0: '%{BKY_RIGHT_HAND_UP}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Right_hand_up'] = function (block) {
  const code = [
    'MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)',
    'MOTOsetspeed(35)',
    'MOTOmove16(80, 30, 100, 108, 93, 55, 124, 100, 120, 170, 100, 92, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 40, 100, 90, 91, 48, 129, 76, 120, 160, 100, 98, 107, 146, 76, 92)',
    'MOTOwait()',
    'MOTOsetspeed(46)',
    'MOTOmove16(40, 43, 141, 90, 101, 71, 112, 69, 44, 86, 100, 98, 107, 146, 76, 92)',
    'MOTOwait()',
    'DelayMs(400)',
    'MOTOsetspeed(35)',
    'MOTOmove16(40, 43, 141, 96, 93, 56, 124, 96, 170, 138, 100, 106, 107, 146, 76, 104)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(35)',
    'MOTOmove16(28, 21, 181, 93, 108, 67, 132, 92, 121, 170, 100, 103, 118, 135, 100, 106)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(35)',
    'MOTOmove16(80, 43, 100, 100, 93, 56, 124, 100, 120, 170, 100, 100, 107, 146, 76, 101)',
    'MOTOwait()',
    'MOTOsetspeed(35)',
    'MOTOmove16(81, 31, 100, 100, 93, 56, 124, 100, 121, 170, 100, 100, 107, 146, 76, 101)',
    'MOTOwait()',
    'MOTOsetspeed(35)',
    'MOTOmove16(80, 30, 100, 108, 93, 55, 124, 100, 120, 170, 100, 92, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Right_hand_up'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['RIGHT_HAND_UP'] + "')\n";
  return code;
}

Blockly.Blocks['1709283579368'] = {
  init: function() {
    this.jsonInit({
      "type": "1709283579368",
      "message0": "左跨步移动",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709283579368'] = function(block) {
  let code = "MOTOrigid16(25,25,25,70,70,70,70,70,25,25,25,70,70,70,70,70)\nMOTOsetspeed(30)\nMOTOmove19(101,97,101,108,93,56,124,100,95,112,101,114,107,145,77,101,0,0,100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(8)\nMOTOmove19(101,97,101,108,93,55,123,111,95,112,101,114,109,152,71,115,0,0,100)\nMOTOwait()\nMOTOsetspeed(34)\nMOTOmove19(101,97,101,105,113,55,130,114,95,112,101,114,58,88,96,117,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709283579368'] = function(block) {
  let code = "base_action.action('左跨步移动')\n";
  return code;
}

Blockly.Blocks['1709288341198'] = {
  init: function() {
    this.jsonInit({
      "type": "1709288341198",
      "message0": "上楼梯",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709288341198'] = function(block) {
  let code = "MOTOrigid16(25,25,25,70,70,70,70,70,25,25,25,70,70,70,70,70)\n\n\n-- 左倾平举手\nMOTOsetspeed(30)\nMOTOmove19(101,97,101,88,93,56,124,101,95,112,101,88,86,102,110,101,0,0,100)\nMOTOwait()\nDelayMs(100)\n\n\n-- 右脚抬腿\nMOTOsetspeed(10)\nMOTOmove19(101,97,101,88,80,56,124,105,95,112,101,88,60,120,95,101,0,0,100)\nMOTOwait()\n\n\n-- 右脚上步\nMOTOsetspeed(10)\nMOTOmove19(101,97,101,92,80,71,76,95,95,112,101,101,86,91,110,102,0,0,100)\nMOTOwait()\nDelayMs(100)\n";
  return code;
}

Blockly.Python['1709288341198'] = function(block) {
  let code = "base_action.action('上楼梯')\n";
  return code;
}

Blockly.Blocks['1709289844649'] = {
  init: function() {
    this.jsonInit({
      "type": "1709289844649",
      "message0": "少年pro",
      "previousStatement": null,
      "nextStatement": null,
      "colour": '#C643F1',
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709289844649'] = function(block) {
  let code = "MOTOsetspeed(30)\nMOTOrigid16(40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,0,0,0)\n\n\n-- 刘叶\nMOTOsetspeed(30)\nMOTOmove19(81, 29, 101, 98, 94, 56, 125, 102, 122, 170, 101, 100, 108, 145, 77, 101, 0, 0, 100)\nMOTOwait()\n\n\n-- 飞翔\nMOTOsetspeed(5)\nMOTOmove19(75, 30, 114, 98, 102, 119, 75, 103, 121, 170, 85, 100, 100, 84, 126, 102, 0, 0, 100)\nMOTOwait()\nDelayMs(1300)\n\n\n-- 飞翔1\nMOTOsetspeed(5)\nMOTOmove19(77, 36, 101, 100, 103, 120, 70, 100, 120, 169, 100, 99, 99, 81, 129, 100, 0, 0, 100)\nMOTOwait()\nDelayMs(1300)\n\n\n-- 1\nMOTOsetspeed(5)\nMOTOmove19(79, 62, 102, 100, 97, 56, 124, 100, 123, 138, 106, 99, 105, 144, 77, 99, 0, 0, 100)\nMOTOwait()\nDelayMs(400)\n\n\n-- 2\nMOTOsetspeed(5)\nMOTOmove19(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100, 0, 0, 100)\nMOTOwait()\nDelayMs(1000)\nMOTOsetspeed(5)\nMOTOmove19(83, 89, 98, 93, 95, 58, 122, 91, 113, 114, 102, 93, 107, 143, 78, 93, 0, 0, 100)\nMOTOwait()\nDelayMs(600)\nMOTOsetspeed(5)\nMOTOmove19(83, 87, 98, 110, 94, 58, 124, 107, 113, 114, 102, 109, 107, 141, 77, 108, 0, 0, 100)\nMOTOwait()\nDelayMs(1400)\nMOTOsetspeed(5)\nMOTOmove19(84, 91, 98, 96, 95, 58, 123, 94, 113, 107, 102, 95, 105, 140, 78, 95, 0, 0, 100)\nMOTOwait()\nDelayMs(1400)\n\n\n-- 从前那个少年\nMOTOsetspeed(30)\nMOTOmove19(81, 90, 103, 100, 93, 55, 124, 100, 190, 167, 16, 100, 107, 145, 76, 100, 0, 0, 140)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(40)\nMOTOmove19(81, 90, 159, 102, 91, 56, 124, 101, 190, 167, 14, 100, 113, 144, 78, 101, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(38, 21, 159, 102, 91, 56, 124, 101, 190, 167, 14, 100, 113, 144, 78, 101, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(168, 66, 120, 95, 88, 54, 123, 91, 28, 131, 80, 107, 108, 142, 78, 105, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(172, 104, 12, 95, 89, 54, 124, 92, 67, 84, 190, 107, 108, 142, 78, 105, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(45)\nMOTOmove19(64, 88, 40, 80, 131, 123, 84, 96, 125, 121, 186, 95, 82, 100, 103, 111, 0, 0, 60)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(45)\nMOTOmove19(64, 88, 170, 80, 131, 123, 84, 96, 125, 121, 26, 95, 82, 100, 103, 111, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(10, 46, 175, 83, 127, 121, 92, 96, 190, 151, 18, 95, 87, 100, 98, 110, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(61, 62, 172, 83, 127, 121, 92, 96, 128, 139, 20, 95, 87, 100, 98, 110, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(78, 41, 185, 78, 129, 98, 115, 82, 109, 176, 14, 104, 76, 108, 78, 112, 0, 0, 100)\nMOTOwait()\n\n\n-- 没有一丝丝改变\nMOTOsetspeed(45)\nMOTOmove19(77, 97, 27, 78, 129, 98, 115, 82, 169, 185, 14, 104, 76, 108, 78, 112, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(94, 68, 104, 67, 135, 103, 109, 85, 130, 190, 44, 94, 72, 118, 76, 109, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(64, 40, 152, 85, 111, 88, 112, 87, 136, 160, 52, 104, 95, 113, 91, 107, 0, 0, 100)\nMOTOwait()\n\n\n-- 时间只不过是考验\nMOTOsetspeed(33)\nMOTOmove19(67, 53, 128, 93, 125, 103, 99, 94, 133, 145, 63, 111, 80, 96, 104, 110, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(33)\nMOTOmove19(67, 39, 106, 99, 100, 56, 125, 97, 104, 31, 105, 111, 107, 145, 77, 109, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(33)\nMOTOmove19(95, 85, 97, 99, 94, 56, 125, 97, 104, 110, 101, 111, 108, 145, 77, 109, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(33)\nMOTOmove19(10, 42, 171, 99, 94, 56, 125, 97, 190, 156, 28, 111, 108, 145, 77, 109, 0, 0, 100)\nMOTOwait()\n\n\n-- 有\nMOTOsetspeed(30)\nMOTOmove19(10, 42, 171, 111, 86, 68, 117, 93, 190, 156, 28, 130, 115, 120, 99, 115, 0, 0, 140)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(30)\nMOTOmove19(10, 42, 171, 72, 119, 101, 104, 90, 190, 156, 28, 88, 106, 138, 75, 111, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(53, 36, 184, 75, 118, 99, 102, 90, 180, 124, 10, 93, 101, 139, 77, 112, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(28, 20, 185, 71, 109, 94, 101, 90, 148, 186, 59, 88, 108, 145, 76, 107, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(70, 49, 151, 97, 85, 43, 131, 84, 129, 159, 61, 116, 93, 111, 95, 105, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(45)\nMOTOmove19(11, 72, 176, 97, 84, 37, 134, 84, 106, 108, 190, 116, 84, 105, 94, 104, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(76, 50, 67, 101, 105, 72, 118, 97, 185, 159, 17, 116, 101, 140, 74, 115, 0, 0, 100)\nMOTOwait()\n\n\n-- 挺\nMOTOsetspeed(20)\nMOTOmove19(76, 50, 67, 83, 123, 80, 123, 83, 185, 159, 17, 109, 82, 114, 90, 112, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(20)\nMOTOmove19(78, 47, 67, 87, 73, 87, 92, 87, 182, 158, 33, 110, 124, 112, 105, 111, 0, 0, 100)\nMOTOwait()\n\n\n-- 1\nMOTOsetspeed(20)\nMOTOmove19(76, 50, 67, 83, 123, 80, 123, 83, 185, 159, 17, 109, 82, 114, 90, 112, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(20)\nMOTOmove19(78, 47, 67, 87, 73, 87, 92, 87, 182, 158, 33, 110, 124, 112, 105, 111, 0, 0, 100)\nMOTOwait()\n\n\n-- 1\nMOTOsetspeed(20)\nMOTOmove19(76, 50, 67, 83, 123, 80, 123, 83, 185, 159, 17, 109, 82, 114, 90, 112, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(20)\nMOTOmove19(78, 47, 67, 87, 73, 87, 92, 87, 182, 158, 33, 110, 124, 112, 105, 111, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(20)\nMOTOmove19(76, 50, 67, 95, 100, 51, 128, 93, 185, 159, 17, 110, 99, 148, 67, 110, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75, 47, 174, 105, 88, 65, 117, 100, 40, 48, 138, 121, 121, 154, 73, 117, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(75, 47, 174, 91, 132, 93, 117, 92, 40, 48, 138, 114, 85, 123, 84, 117, 0, 0, 100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(45)\nMOTOmove19(76, 31, 128, 97, 112, 55, 137, 95, 115, 168, 60, 114, 89, 151, 58, 112, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(52, 58, 106, 97, 112, 55, 137, 95, 79, 42, 130, 114, 89, 151, 58, 112, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(52, 58, 106, 92, 135, 98, 117, 91, 135, 189, 49, 115, 84, 115, 87, 117, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(71, 29, 152, 90, 101, 48, 138, 88, 70, 20, 140, 108, 97, 139, 70, 108, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(45, 31, 146, 97, 118, 79, 119, 97, 70, 20, 141, 117, 99, 147, 70, 119, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(71, 29, 152, 107, 88, 65, 113, 95, 70, 20, 140, 129, 114, 145, 80, 120, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(60, 20, 156, 107, 88, 65, 113, 95, 70, 32, 190, 129, 114, 145, 80, 120, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(101, 116, 109, 95, 93, 65, 118, 91, 60, 51, 90, 115, 119, 150, 78, 114, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\n\n\n-- 方年隆呜\nMOTOsetspeed(30)\nMOTOmove19(79, 30, 101, 100, 94, 56, 123, 101, 120, 170, 101, 101, 107, 144, 77, 101, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(15)\nMOTOmove19(20, 78, 104, 92, 94, 56, 123, 92, 120, 172, 51, 106, 107, 144, 77, 105, 0, 0, 80)\nMOTOwait()\nMOTOsetspeed(15)\nMOTOmove19(20, 84, 105, 92, 94, 56, 123, 92, 121, 172, 21, 106, 107, 144, 77, 105, 0, 0, 60)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(15)\nMOTOmove19(51, 86, 110, 92, 94, 56, 123, 92, 181, 171, 20, 106, 107, 144, 77, 105, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(25)\nMOTOmove19(38, 100, 92, 65, 86, 65, 117, 65, 181, 171, 20, 90, 101, 82, 123, 92, 0, 0, 140)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(10)\nMOTOmove19(20, 58, 181, 61, 88, 64, 116, 66, 181, 171, 20, 92, 99, 93, 117, 90, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(81, 109, 190, 61, 88, 64, 116, 66, 181, 171, 20, 92, 99, 93, 117, 90, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(10, 49, 179, 85, 102, 77, 117, 84, 181, 171, 20, 108, 106, 121, 93, 110, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(80, 88, 178, 96, 99, 68, 119, 94, 116, 117, 22, 101, 106, 133, 82, 103, 0, 0, 100)\nMOTOwait()\nDelayMs(400)\nMOTOsetspeed(40)\nMOTOmove19(82, 52, 101, 88, 87, 57, 117, 88, 171, 177, 35, 99, 110, 134, 88, 100, 0, 0, 100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(40)\nMOTOmove19(82, 52, 101, 80, 86, 56, 123, 81, 150, 177, 35, 100, 108, 119, 100, 97, 0, 0, 140)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(40)\nMOTOmove19(82, 52, 165, 80, 86, 56, 123, 81, 150, 177, 35, 100, 108, 119, 100, 97, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(29, 23, 165, 100, 92, 81, 100, 103, 118, 148, 99, 120, 114, 144, 77, 119, 0, 0, 60)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(40)\nMOTOmove19(50, 23, 165, 100, 92, 81, 100, 103, 118, 148, 99, 120, 114, 144, 77, 119, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(82, 52, 165, 100, 92, 81, 100, 103, 118, 148, 35, 120, 114, 144, 77, 119, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(82, 52, 101, 80, 86, 56, 123, 81, 171, 177, 35, 100, 108, 119, 100, 97, 0, 0, 140)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(40)\nMOTOmove19(82, 52, 101, 80, 86, 56, 123, 81, 150, 177, 35, 100, 108, 119, 100, 97, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(82, 52, 165, 80, 86, 56, 123, 81, 118, 148, 35, 100, 108, 119, 100, 97, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(29, 23, 165, 100, 92, 81, 100, 103, 118, 148, 99, 120, 114, 144, 77, 119, 0, 0, 60)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(40)\nMOTOmove19(50, 23, 165, 100, 92, 81, 100, 103, 118, 148, 99, 120, 114, 144, 77, 119, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(49, 45, 190, 81, 118, 102, 102, 91, 139, 173, 10, 100, 95, 118, 89, 113, 0, 0, 100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(40)\nMOTOmove19(81, 48, 99, 100, 105, 65, 123, 92, 116, 146, 100, 106, 90, 127, 78, 103, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(40)\nMOTOmove19(81, 48, 165, 100, 105, 65, 123, 92, 116, 146, 100, 106, 90, 127, 78, 103, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(29, 23, 165, 100, 92, 81, 100, 103, 118, 148, 99, 120, 114, 144, 77, 119, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(50, 23, 165, 100, 92, 81, 100, 103, 118, 148, 99, 120, 114, 144, 77, 119, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(82, 52, 165, 100, 92, 81, 100, 103, 118, 148, 35, 120, 114, 144, 77, 119, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(82, 52, 101, 80, 86, 56, 123, 81, 171, 177, 35, 100, 108, 119, 100, 97, 0, 0, 60)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(40)\nMOTOmove19(82, 52, 101, 80, 86, 56, 123, 81, 150, 177, 35, 100, 108, 119, 100, 97, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(145, 20, 153, 101, 92, 57, 124, 102, 44, 180, 37, 102, 107, 144, 77, 101, 0, 0, 100)\nMOTOwait()\nDelayMs(50)\nMOTOsetspeed(40)\nMOTOmove19(82, 52, 100, 101, 92, 57, 124, 102, 116, 146, 100, 102, 107, 144, 77, 101, 0, 0, 100)\nMOTOwait()\n\n\n-- 风起云涌\nMOTOsetspeed(40)\nMOTOmove19(63, 35, 140, 102, 91, 58, 124, 100, 144, 165, 32, 100, 108, 138, 76, 99, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(49, 23, 155, 101, 92, 57, 124, 102, 167, 167, 15, 102, 107, 144, 77, 101, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(49, 23, 155, 101, 92, 57, 124, 102, 160, 163, 18, 102, 107, 144, 77, 101, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(12, 45, 181, 101, 92, 57, 124, 102, 157, 177, 17, 102, 107, 144, 77, 101, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(12, 45, 190, 101, 92, 57, 124, 102, 158, 172, 46, 102, 107, 144, 77, 101, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(79, 14, 180, 101, 92, 57, 124, 102, 175, 170, 17, 102, 107, 144, 77, 101, 0, 0, 100)\nMOTOwait()\nDelayMs(200)\n\n\n-- 暴风少年登场\nMOTOsetspeed(40)\nMOTOmove19(79, 15, 189, 91, 92, 53, 128, 90, 129, 176, 50, 112, 107, 143, 78, 110, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(80, 15, 158, 91, 92, 53, 128, 90, 129, 176, 21, 112, 107, 143, 78, 110, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(115, 182, 89, 91, 92, 53, 128, 90, 76, 27, 111, 112, 107, 143, 78, 110, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\n\n\n-- 战胜烈火\nMOTOsetspeed(33)\nMOTOmove19(90, 100, 96, 91, 110, 94, 105, 88, 102, 18, 180, 111, 103, 110, 102, 111, 0, 0, 140)\nMOTOwait()\n\n\n-- 1\nMOTOsetspeed(33)\nMOTOmove19(90, 100, 96, 91, 88, 39, 139, 90, 102, 18, 180, 113, 109, 157, 66, 110, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(33)\nMOTOmove19(90, 100, 96, 94, 96, 85, 106, 88, 102, 18, 180, 113, 109, 111, 103, 110, 0, 0, 100)\nMOTOwait()\n\n\n-- 1\nMOTOsetspeed(33)\nMOTOmove19(90, 100, 96, 91, 88, 39, 139, 90, 102, 18, 180, 113, 109, 157, 66, 110, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(90, 100, 96, 91, 95, 39, 139, 90, 190, 26, 180, 113, 100, 157, 66, 110, 0, 0, 100)\nMOTOwait()\n\n\n-- 喧闹整个世界\nMOTOsetspeed(40)\nMOTOmove19(17, 176, 97, 91, 95, 39, 139, 90, 110, 188, 10, 113, 100, 157, 66, 110, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(17, 86, 97, 91, 95, 39, 139, 90, 110, 97, 10, 113, 100, 157, 66, 110, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(17, 85, 97, 91, 95, 39, 139, 90, 113, 15, 166, 113, 100, 157, 66, 110, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(95, 178, 32, 90, 91, 46, 137, 87, 113, 15, 166, 112, 109, 145, 73, 109, 0, 0, 100)\nMOTOwait()\n\n\n-- 硝烟狂飞\nMOTOsetspeed(40)\nMOTOmove19(157, 160, 20, 100, 108, 85, 110, 101, 120, 89, 175, 115, 110, 145, 77, 119, 0, 0, 80)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(50)\nMOTOmove19(157, 105, 134, 109, 119, 89, 111, 104, 120, 89, 175, 137, 99, 153, 70, 127, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(50)\nMOTOmove19(73, 40, 168, 109, 119, 89, 111, 104, 120, 89, 175, 137, 99, 153, 70, 127, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(50)\nMOTOmove19(18, 27, 183, 109, 119, 89, 111, 104, 120, 89, 175, 137, 99, 153, 70, 127, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(50)\nMOTOmove19(15, 51, 181, 109, 119, 89, 111, 104, 120, 89, 175, 137, 99, 153, 70, 127, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(50)\nMOTOmove19(18, 27, 183, 109, 119, 89, 111, 104, 120, 89, 175, 137, 99, 153, 70, 127, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(50)\nMOTOmove19(15, 51, 181, 109, 119, 89, 111, 104, 120, 89, 175, 137, 99, 153, 70, 127, 0, 0, 100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(50)\nMOTOmove19(80, 111, 181, 109, 119, 89, 111, 104, 120, 89, 175, 137, 99, 153, 70, 127, 0, 0, 100)\nMOTOwait()\n\n\n-- 机甲\nMOTOsetspeed(50)\nMOTOmove19(80, 111, 25, 81, 99, 72, 118, 76, 43, 40, 180, 104, 84, 101, 95, 105, 0, 0, 140)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(50)\nMOTOmove19(80, 111, 25, 63, 101, 47, 130, 73, 43, 95, 66, 91, 81, 111, 89, 96, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(50)\nMOTOmove19(80, 111, 25, 62, 101, 56, 129, 71, 127, 160, 32, 91, 88, 110, 90, 101, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\n\n\n-- 操控我的权势\nMOTOsetspeed(35)\nMOTOmove19(84, 91, 12, 96, 98, 68, 116, 97, 80, 25, 113, 105, 105, 135, 82, 106, 0, 0, 140)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(50)\nMOTOmove19(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(125, 175, 87, 94, 100, 58, 128, 92, 45, 106, 188, 101, 99, 142, 71, 102, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(125, 175, 87, 94, 100, 58, 128, 92, 103, 115, 189, 101, 99, 142, 71, 102, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(125, 175, 87, 95, 75, 58, 115, 94, 25, 78, 190, 102, 126, 140, 87, 103, 0, 0, 100)\nMOTOwait()\nDelayMs(500)\nMOTOsetspeed(40)\nMOTOmove19(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(80, 30, 180, 100, 93, 55, 124, 100, 120, 170, 20, 100, 107, 145, 76, 100, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(20, 40, 189, 101, 91, 54, 131, 99, 181, 165, 14, 100, 110, 145, 73, 101, 0, 0, 100)\nMOTOwait()\nDelayMs(300)\nMOTOsetspeed(15)\nMOTOmove19(20, 40, 189, 100, 121, 112, 96, 100, 181, 165, 14, 99, 79, 93, 100, 101, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(5)\nMOTOmove19(61, 10, 186, 100, 121, 111, 95, 100, 156, 186, 16, 98, 80, 89, 104, 99, 0, 0, 100)\nMOTOwait()\nDelayMs(500)\nMOTOsetspeed(30)\nMOTOmove19(61, 10, 186, 82, 100, 82, 107, 84, 156, 186, 16, 106, 99, 119, 89, 110, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(87, 45, 127, 81, 101, 70, 122, 76, 121, 155, 51, 123, 101, 133, 81, 123, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(87, 45, 31, 84, 99, 61, 123, 83, 121, 155, 51, 117, 102, 140, 80, 135, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(85, 103, 102, 84, 99, 61, 123, 83, 118, 100, 105, 117, 102, 140, 80, 112, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(59, 43, 157, 84, 99, 61, 123, 60, 118, 160, 170, 117, 102, 140, 80, 112, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(85, 103, 102, 84, 99, 61, 123, 83, 118, 100, 105, 117, 102, 140, 80, 112, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(87, 39, 37, 84, 99, 61, 123, 83, 121, 160, 51, 117, 102, 140, 80, 135, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(87, 43, 157, 94, 95, 62, 123, 76, 118, 160, 170, 107, 103, 138, 81, 111, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(87, 43, 157, 94, 95, 62, 123, 95, 118, 160, 170, 107, 103, 138, 81, 111, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(140, 165, 107, 66, 116, 99, 99, 71, 67, 30, 107, 94, 91, 80, 119, 104, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(140, 151, 151, 77, 114, 100, 96, 75, 67, 30, 43, 100, 84, 79, 123, 102, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(131, 165, 38, 87, 130, 107, 103, 86, 67, 39, 156, 124, 76, 101, 90, 122, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(140, 165, 107, 69, 113, 93, 100, 71, 45, 50, 104, 98, 90, 72, 129, 101, 0, 0, 100)\nMOTOwait()\n\n\n-- 1\nMOTOsetspeed(30)\nMOTOmove19(93, 182, 92, 98, 114, 82, 109, 92, 87, 24, 104, 120, 86, 114, 90, 115, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(175, 86, 106, 112, 120, 86, 114, 93, 25, 99, 104, 139, 84, 113, 91, 122, 0, 0, 100)\nMOTOwait()\n\n\n-- 1\nMOTOsetspeed(30)\nMOTOmove19(93, 182, 92, 98, 114, 82, 109, 92, 87, 24, 104, 120, 86, 114, 90, 115, 0, 0, 100)\nMOTOwait()\n\n\n-- 第四段\nMOTOsetspeed(40)\nMOTOmove19(80, 36, 105, 102, 106, 58, 129, 103, 121, 158, 90, 100, 97, 142, 72, 102, 0, 0, 100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(40)\nMOTOmove19(80, 36, 105, 102, 106, 58, 129, 103, 121, 158, 45, 100, 97, 142, 72, 102, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(80, 36, 105, 99, 107, 65, 129, 99, 190, 158, 44, 98, 99, 137, 76, 100, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(73, 15, 189, 102, 106, 58, 129, 103, 188, 157, 44, 100, 97, 142, 72, 102, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(11, 47, 153, 102, 106, 58, 129, 103, 188, 157, 44, 100, 97, 142, 72, 102, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(30, 20, 180, 100, 95, 57, 128, 100, 160, 173, 43, 100, 104, 145, 73, 99, 0, 0, 100)\nMOTOwait()\n\n\n-- 换右腿\nMOTOsetspeed(35)\nMOTOmove19(100, 58, 109, 96, 113, 66, 127, 100, 49, 107, 110, 97, 102, 157, 62, 104, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(141, 59, 64, 94, 105, 58, 127, 97, 118, 107, 13, 114, 98, 153, 65, 114, 0, 0, 100)\nMOTOwait()\n\n\n-- 扭下\nMOTOsetspeed(45)\nMOTOmove19(50, 44, 70, 89, 99, 62, 125, 83, 52, 27, 162, 104, 89, 116, 89, 100, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(57, 31, 63, 86, 122, 120, 83, 96, 68, 52, 160, 108, 85, 109, 93, 119, 0, 0, 60)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(45)\nMOTOmove19(57, 79, 124, 85, 148, 139, 87, 88, 105, 58, 111, 111, 57, 68, 108, 116, 0, 0, 100)\nMOTOwait()\n\n\n-- 左脚后\nMOTOsetspeed(40)\nMOTOmove19(12, 36, 190, 81, 95, 53, 128, 77, 165, 181, 41, 111, 90, 108, 91, 107, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(39, 28, 150, 78, 100, 57, 129, 77, 175, 157, 51, 108, 91, 115, 90, 107, 0, 0, 100)\nMOTOwait()\nDelayMs(300)\nMOTOsetspeed(35)\nMOTOmove19(175, 125, 90, 99, 109, 99, 94, 101, 50, 67, 116, 117, 109, 133, 89, 122, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(95, 105, 114, 90, 96, 58, 119, 89, 106, 99, 106, 108, 99, 137, 79, 108, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(95, 105, 114, 90, 96, 58, 119, 89, 106, 99, 60, 108, 99, 137, 79, 108, 0, 0, 100)\nMOTOwait()\n\n\n-- 左脚后\nMOTOsetspeed(40)\nMOTOmove19(60, 74, 73, 82, 92, 56, 117, 79, 172, 183, 30, 105, 90, 105, 97, 102, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(80, 37, 152, 90, 107, 55, 130, 84, 155, 132, 87, 107, 78, 111, 85, 100, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(56, 37, 176, 90, 107, 55, 130, 84, 155, 132, 87, 107, 78, 111, 85, 100, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(37)\nMOTOmove19(35, 18, 176, 98, 105, 79, 110, 100, 159, 159, 163, 118, 116, 165, 66, 122, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(37)\nMOTOmove19(35, 18, 176, 98, 105, 79, 110, 100, 138, 159, 163, 118, 116, 165, 66, 122, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(37)\nMOTOmove19(57, 13, 157, 93, 102, 44, 143, 84, 121, 152, 70, 109, 90, 123, 86, 103, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(37)\nMOTOmove19(94, 76, 143, 100, 125, 119, 86, 94, 121, 121, 60, 98, 75, 82, 110, 98, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(37)\nMOTOmove19(175, 118, 96, 95, 119, 105, 94, 93, 36, 67, 113, 109, 79, 95, 100, 108, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(37)\nMOTOmove19(100, 75, 164, 94, 119, 80, 117, 92, 109, 177, 28, 107, 82, 126, 78, 108, 0, 0, 100)\nMOTOwait()\nDelayMs(200)\n\n\n-- 15秒\nMOTOsetspeed(40)\nMOTOmove19(17, 41, 160, 96, 103, 74, 114, 91, 190, 159, 14, 103, 90, 108, 93, 97, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(60, 51, 135, 100, 112, 95, 102, 100, 130, 154, 71, 104, 85, 101, 96, 103, 0, 0, 100)\nMOTOwait()\nDelayMs(400)\nMOTOsetspeed(35)\nMOTOmove19(89, 91, 167, 93, 98, 83, 101, 91, 113, 108, 35, 104, 99, 117, 92, 106, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(79, 35, 125, 101, 121, 79, 122, 99, 124, 167, 77, 104, 81, 119, 81, 104, 0, 0, 100)\nMOTOwait()\n\n\n-- 两次\nMOTOsetspeed(30)\nMOTOmove19(93, 84, 96, 103, 92, 55, 122, 101, 109, 109, 100, 103, 107, 143, 79, 101, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(39, 81, 30, 103, 100, 56, 126, 101, 179, 94, 168, 103, 101, 140, 77, 102, 0, 0, 100)\nMOTOwait()\nDelayMs(150)\nMOTOsetspeed(60)\nMOTOmove19(29, 81, 101, 103, 100, 56, 126, 101, 180, 103, 95, 103, 101, 140, 77, 102, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(60)\nMOTOmove19(29, 81, 160, 103, 100, 56, 126, 101, 180, 103, 30, 103, 101, 140, 77, 102, 0, 0, 100)\nMOTOwait()\n\n\n-- 左右\nMOTOsetspeed(35)\nMOTOmove19(12, 36, 172, 91, 105, 65, 124, 84, 181, 164, 20, 112, 86, 108, 91, 106, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(49, 49, 179, 96, 131, 99, 108, 99, 109, 61, 99, 113, 84, 122, 84, 119, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(50)\nMOTOmove19(94, 130, 102, 94, 122, 100, 106, 96, 140, 173, 35, 114, 92, 120, 87, 118, 0, 0, 140)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(45)\nMOTOmove19(55, 27, 157, 94, 100, 84, 107, 89, 140, 165, 52, 113, 104, 114, 100, 111, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(55, 27, 157, 94, 100, 84, 107, 89, 129, 165, 52, 113, 104, 114, 100, 111, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(95, 163, 111, 97, 109, 69, 116, 99, 129, 156, 99, 107, 99, 148, 70, 110, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(50)\nMOTOmove19(89, 113, 103, 100, 103, 52, 130, 93, 104, 56, 89, 112, 95, 132, 82, 106, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(10, 38, 169, 91, 124, 121, 86, 92, 185, 162, 40, 106, 80, 86, 112, 110, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(89, 68, 122, 94, 123, 121, 88, 97, 112, 140, 72, 107, 75, 79, 106, 107, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(50)\nMOTOmove19(25, 38, 186, 94, 123, 121, 88, 97, 175, 159, 48, 107, 75, 79, 106, 107, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(50)\nMOTOmove19(25, 44, 154, 94, 123, 121, 88, 97, 175, 162, 14, 107, 75, 79, 106, 107, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(50)\nMOTOmove19(25, 38, 186, 94, 123, 121, 88, 97, 175, 159, 48, 107, 75, 79, 106, 107, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(50)\nMOTOmove19(25, 44, 154, 94, 123, 121, 88, 97, 175, 162, 14, 107, 75, 79, 106, 107, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(50)\nMOTOmove19(75, 37, 141, 97, 114, 91, 110, 93, 117, 177, 20, 115, 93, 115, 89, 113, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(59, 49, 102, 104, 99, 47, 136, 98, 25, 100, 95, 102, 99, 145, 71, 100, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(59, 58, 117, 97, 98, 64, 119, 94, 96, 30, 111, 113, 109, 147, 76, 111, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(93, 170, 101, 100, 113, 54, 136, 100, 104, 33, 96, 101, 82, 145, 64, 101, 0, 0, 100)\nMOTOwait()\nDelayMs(150)\n\n\n-- 羽羽\nMOTOsetspeed(35)\nMOTOmove19(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(13)\nMOTOmove19(30, 73, 99, 100, 92, 56, 123, 105, 121, 171, 59, 101, 107, 144, 76, 104, 0, 0, 90)\nMOTOwait()\nMOTOsetspeed(13)\nMOTOmove19(30, 73, 99, 100, 92, 56, 123, 105, 121, 171, 26, 101, 107, 144, 76, 104, 0, 0, 75)\nMOTOwait()\nMOTOsetspeed(13)\nMOTOmove19(30, 73, 99, 100, 92, 56, 123, 105, 121, 171, 10, 101, 107, 144, 76, 104, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(13)\nMOTOmove19(79, 30, 101, 100, 92, 56, 123, 105, 120, 158, 11, 101, 107, 144, 76, 104, 0, 0, 100)\nMOTOwait()\nDelayMs(250)\nMOTOsetspeed(13)\nMOTOmove19(83, 23, 134, 103, 92, 57, 123, 103, 165, 131, 100, 102, 106, 142, 75, 101, 0, 0, 110)\nMOTOwait()\nMOTOsetspeed(13)\nMOTOmove19(83, 24, 154, 105, 98, 57, 127, 99, 165, 131, 100, 102, 97, 133, 81, 98, 0, 0, 125)\nMOTOwait()\nMOTOsetspeed(13)\nMOTOmove19(83, 25, 168, 102, 91, 53, 126, 99, 165, 131, 100, 100, 106, 139, 78, 98, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(13)\nMOTOmove19(83, 38, 187, 94, 95, 59, 126, 89, 165, 131, 100, 92, 103, 136, 78, 91, 0, 0, 100)\nMOTOwait()\nDelayMs(250)\n\n\n-- 唱歌\nMOTOsetspeed(30)\nMOTOmove19(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 60, 100, 107, 145, 76, 100, 0, 0, 100)\nMOTOwait()\n\n\n-- 我还是\nMOTOsetspeed(40)\nMOTOmove19(84, 97, 100, 103, 97, 66, 123, 102, 185, 167, 20, 103, 109, 143, 77, 106, 0, 0, 140)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(40)\nMOTOmove19(84, 97, 140, 103, 97, 66, 123, 102, 185, 167, 20, 103, 109, 143, 77, 106, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(38, 21, 159, 97, 97, 64, 124, 94, 185, 167, 20, 104, 109, 144, 77, 106, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(71, 21, 159, 97, 97, 64, 124, 94, 149, 167, 20, 104, 109, 144, 77, 106, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(91, 30, 91, 96, 94, 57, 122, 94, 129, 152, 111, 107, 108, 142, 80, 107, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(42, 64, 182, 95, 97, 63, 123, 94, 159, 136, 15, 105, 107, 137, 79, 106, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(45)\nMOTOmove19(64, 88, 40, 94, 116, 86, 104, 98, 125, 121, 186, 111, 100, 143, 79, 117, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(64, 88, 160, 94, 116, 86, 104, 98, 125, 121, 30, 111, 100, 143, 79, 117, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(10, 56, 186, 79, 115, 92, 110, 84, 190, 157, 17, 107, 101, 127, 85, 117, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(141, 42, 184, 75, 120, 89, 111, 84, 52, 176, 37, 107, 96, 132, 81, 116, 0, 0, 100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(45)\nMOTOmove19(131, 125, 66, 75, 120, 89, 111, 84, 33, 130, 136, 107, 96, 132, 81, 116, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(45)\nMOTOmove19(99, 172, 20, 80, 125, 91, 117, 87, 118, 17, 180, 105, 80, 119, 75, 112, 0, 0, 100)\nMOTOwait()\nDelayMs(200)\n\n\n-- 没有一丝丝改变\nMOTOsetspeed(45)\nMOTOmove19(94, 103, 20, 90, 112, 66, 125, 83, 190, 157, 22, 117, 82, 109, 89, 111, 0, 0, 140)\nMOTOwait()\nDelayMs(700)\nMOTOsetspeed(35)\nMOTOmove19(94, 68, 104, 70, 145, 111, 108, 88, 137, 190, 54, 94, 79, 129, 75, 117, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(64, 40, 152, 93, 95, 87, 99, 89, 136, 160, 52, 114, 112, 119, 99, 115, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(20)\nMOTOmove19(45, 18, 152, 93, 88, 80, 101, 88, 152, 182, 48, 114, 111, 116, 100, 111, 0, 0, 100)\nMOTOwait()\n\n\n-- 时间只不过\nMOTOsetspeed(33)\nMOTOmove19(67, 53, 128, 93, 125, 95, 112, 93, 133, 145, 63, 110, 79, 107, 87, 111, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(33)\nMOTOmove19(67, 53, 128, 98, 95, 66, 118, 93, 133, 145, 63, 116, 115, 153, 71, 116, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(33)\nMOTOmove19(67, 39, 106, 99, 94, 56, 125, 97, 104, 31, 105, 111, 108, 145, 77, 109, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(33)\nMOTOmove19(95, 85, 97, 99, 94, 56, 125, 97, 104, 110, 101, 111, 108, 145, 77, 109, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(33)\nMOTOmove19(10, 42, 171, 99, 94, 56, 125, 97, 190, 156, 28, 111, 108, 145, 77, 109, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(10, 42, 171, 89, 90, 76, 110, 86, 190, 156, 28, 106, 112, 120, 99, 107, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(10, 42, 171, 96, 119, 105, 99, 97, 190, 156, 28, 119, 97, 133, 78, 125, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(53, 36, 184, 89, 121, 96, 113, 91, 180, 124, 10, 119, 102, 134, 80, 124, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(28, 20, 185, 71, 109, 94, 101, 90, 148, 170, 59, 88, 108, 145, 76, 107, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(35)\nMOTOmove19(70, 49, 151, 96, 96, 36, 143, 82, 129, 159, 61, 115, 86, 110, 94, 103, 0, 0, 100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(45)\nMOTOmove19(11, 72, 176, 97, 84, 37, 134, 84, 106, 108, 180, 116, 84, 105, 94, 104, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(11, 72, 176, 97, 84, 37, 134, 84, 106, 108, 100, 116, 84, 105, 94, 104, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(76, 50, 67, 106, 101, 57, 127, 101, 185, 159, 17, 123, 98, 150, 68, 115, 0, 0, 100)\nMOTOwait()\n\n\n-- 挺\nMOTOsetspeed(20)\nMOTOmove19(76, 50, 67, 86, 108, 62, 128, 87, 185, 159, 17, 108, 102, 140, 80, 111, 0, 0, 100)\nMOTOwait()\n\n\n-- 1\nMOTOsetspeed(20)\nMOTOmove19(76, 50, 67, 85, 67, 66, 106, 88, 185, 159, 17, 111, 155, 170, 75, 115, 0, 0, 100)\nMOTOwait()\n\n\n-- 挺\nMOTOsetspeed(20)\nMOTOmove19(76, 50, 67, 86, 108, 62, 128, 87, 185, 159, 17, 108, 102, 140, 80, 111, 0, 0, 100)\nMOTOwait()\n\n\n-- 1\nMOTOsetspeed(20)\nMOTOmove19(76, 50, 67, 85, 67, 66, 106, 88, 185, 159, 17, 111, 155, 170, 75, 115, 0, 0, 100)\nMOTOwait()\n\n\n-- 挺\nMOTOsetspeed(20)\nMOTOmove19(76, 50, 67, 86, 108, 62, 128, 87, 185, 159, 17, 108, 102, 140, 80, 111, 0, 0, 100)\nMOTOwait()\n\n\n-- 1\nMOTOsetspeed(20)\nMOTOmove19(76, 50, 67, 85, 67, 66, 106, 88, 185, 159, 17, 111, 155, 170, 75, 115, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(76, 50, 67, 106, 101, 57, 127, 101, 185, 159, 17, 123, 98, 150, 68, 115, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(30)\nMOTOmove19(75, 47, 112, 106, 101, 57, 127, 101, 66, 27, 136, 123, 98, 150, 68, 115, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(75, 47, 159, 106, 101, 57, 127, 101, 66, 27, 136, 123, 98, 150, 68, 115, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(40)\nMOTOmove19(16, 45, 159, 103, 89, 50, 127, 96, 127, 126, 91, 115, 112, 151, 73, 112, 0, 0, 100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(45)\nMOTOmove19(76, 31, 128, 97, 112, 55, 137, 95, 115, 168, 60, 114, 89, 151, 58, 112, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(45)\nMOTOmove19(40, 58, 106, 97, 112, 55, 137, 95, 79, 42, 130, 114, 89, 151, 58, 112, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(40, 58, 106, 102, 116, 100, 102, 99, 135, 189, 49, 121, 99, 126, 87, 124, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(71, 29, 152, 84, 93, 67, 118, 79, 59, 30, 140, 105, 103, 119, 96, 107, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(29, 31, 140, 102, 93, 86, 97, 99, 59, 30, 141, 123, 113, 141, 82, 124, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(71, 29, 152, 104, 108, 73, 119, 94, 59, 30, 140, 119, 95, 113, 95, 111, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(31, 30, 167, 107, 88, 70, 113, 94, 45, 43, 180, 129, 118, 143, 83, 122, 0, 0, 100)\nMOTOwait()\n\n\n-- 面\nMOTOsetspeed(30)\nMOTOmove19(16, 45, 159, 88, 108, 85, 114, 93, 127, 126, 91, 112, 119, 166, 61, 119, 0, 0, 60)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(172, 128, 126, 91, 121, 63, 131, 96, 42, 51, 90, 106, 84, 146, 65, 109, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(40, 40, 55, 111, 78, 75, 103, 93, 184, 177, 39, 134, 122, 123, 99, 120, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(76, 50, 67, 106, 101, 57, 127, 101, 177, 144, 17, 123, 98, 150, 68, 115, 0, 0, 100)\nMOTOwait()\n\n\n-- 1\nMOTOsetspeed(30)\nMOTOmove19(40, 40, 55, 111, 78, 75, 103, 93, 184, 177, 39, 134, 122, 123, 99, 120, 0, 0, 140)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(140, 168, 118, 96, 113, 73, 117, 87, 37, 58, 78, 108, 81, 101, 96, 100, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(30)\nMOTOmove19(23, 68, 143, 96, 113, 73, 117, 87, 37, 103, 62, 108, 81, 101, 96, 100, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(107, 64, 28, 75, 128, 90, 113, 73, 98, 119, 181, 103, 71, 89, 102, 101, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(34)\nMOTOmove19(145, 163, 102, 89, 119, 104, 95, 92, 50, 42, 99, 116, 89, 126, 81, 122, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(34)\nMOTOmove19(86, 96, 28, 91, 120, 91, 109, 91, 96, 121, 167, 117, 92, 127, 82, 120, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(168, 96, 187, 91, 120, 91, 109, 91, 32, 69, 87, 117, 92, 127, 82, 120, 0, 0, 100)\nMOTOwait()\n\n\n-- 往上\nMOTOsetspeed(11)\nMOTOmove19(67, 53, 102, 88, 101, 78, 106, 88, 134, 135, 100, 114, 98, 121, 89, 113, 0, 0, 100)\nMOTOwait()\nDelayMs(300)\nMOTOsetspeed(11)\nMOTOmove19(67, 67, 142, 98, 114, 83, 110, 94, 133, 133, 58, 125, 97, 145, 70, 122, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(11)\nMOTOmove19(66, 117, 122, 103, 114, 92, 103, 97, 134, 83, 78, 131, 99, 130, 85, 125, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(11)\nMOTOmove19(81, 145, 98, 91, 127, 102, 100, 94, 119, 55, 102, 120, 91, 125, 85, 122, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(11)\nMOTOmove19(67, 67, 142, 99, 115, 89, 111, 98, 133, 133, 58, 126, 104, 146, 73, 122, 0, 0, 100)\nMOTOwait()\n\n\n-- 站立\nMOTOsetspeed(30)\nMOTOmove19(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100, 0, 0, 100)\nMOTOwait()\n\n\n-- 1\nMOTOsetspeed(28)\nMOTOmove19(80, 35, 160, 100, 93, 55, 124, 100, 120, 130, 100, 100, 107, 145, 76, 100, 0, 0, 100)\nMOTOwait()\n\n\n-- 2\nMOTOsetspeed(35)\nMOTOmove19(20, 20, 175, 100, 93, 55, 124, 100, 120, 130, 100, 100, 107, 145, 76, 100, 0, 0, 100)\nMOTOwait()\n\n\n-- 3\nMOTOsetspeed(30)\nMOTOmove19(20, 20, 175, 100, 145, 55, 145, 100, 120, 130, 100, 100, 55, 145, 55, 100, 0, 0, 100)\nMOTOwait()\n\n\n-- 4\nMOTOsetspeed(21)\nMOTOmove19(20, 20, 175, 100, 93, 55, 124, 100, 120, 130, 100, 100, 107, 145, 76, 100, 0, 0, 100)\nMOTOwait()\n\n\n-- 5\nMOTOsetspeed(28)\nMOTOmove19(80, 40, 160, 100, 93, 55, 124, 100, 120, 130, 100, 100, 107, 145, 76, 100, 0, 0, 100)\nMOTOwait()\n\n\n-- 6\nMOTOsetspeed(35)\nMOTOmove19(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100, 0, 0, 100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709289844649'] = function(block) {
  let code = "base_action.action('少年pro')\n";
  return code;
}

Blockly.Blocks['1709615211400'] = {
  init: function() {
    this.jsonInit({
      "type": "1709615211400",
      "message0": "上一",
      "previousStatement": null,
      "nextStatement": null,
      "colour": '#C643F1',
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709615211400'] = function(block) {
  let code = "MOTOsetspeed(30)\nMOTOrigid16(40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,0,0,0)\nMOTOsetspeed(30)\nMOTOmove19(86, 105, 100, 99, 92, 56, 123, 100, 105, 95, 100, 100, 106, 144, 75, 99, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(86, 105, 100, 93, 93, 55, 123, 86, 105, 95, 100, 93, 106, 143, 75, 92, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(15)\nMOTOmove19(86, 105, 100, 90, 123, 117, 100, 91, 105, 95, 100, 95, 106, 143, 75, 89, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(15)\nMOTOmove19(86, 105, 100, 90, 151, 66, 170, 83, 105, 95, 100, 95, 132, 140, 92, 89, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(15)\nMOTOmove19(86, 105, 100, 95, 127, 39, 183, 97, 105, 95, 100, 95, 157, 154, 108, 101, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(15)\nMOTOmove19(86, 105, 100, 95, 160, 39, 185, 104, 105, 95, 100, 95, 129, 158, 103, 105, 0, 0, 100)\nMOTOwait()\n\n\n-- 脚尖重心\nMOTOsetspeed(15)\nMOTOmove19(86, 105, 100, 95, 160, 39, 183, 104, 105, 95, 100, 95, 128, 158, 95, 107, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(15)\nMOTOmove19(86, 105, 100, 85, 155, 40, 165, 107, 105, 95, 100, 90, 110, 165, 57, 115, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(15)\nMOTOmove19(86, 105, 100, 93, 98, 46, 127, 109, 105, 95, 100, 98, 144, 169, 10, 109, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(86, 105, 100, 93, 98, 46, 127, 111, 105, 95, 100, 101, 122, 133, 120, 108, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(25)\nMOTOmove19(86, 105, 100, 100, 98, 46, 133, 110, 105, 95, 100, 106, 103, 153, 72, 109, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(86, 105, 100, 101, 94, 57, 125, 101, 105, 95, 100, 100, 107, 145, 77, 103, 0, 0, 100)\nMOTOwait()\nDelayMs(200)\n";
  return code;
}

Blockly.Python['1709615211400'] = function(block) {
  let code = "base_action.action('上一')\n";
  return code;
}

Blockly.Blocks['1709615230198'] = {
  init: function() {
    this.jsonInit({
      "type": "1709615230198",
      "message0": "下一",
      "previousStatement": null,
      "nextStatement": null,
      "colour": '#C643F1',
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709615230198'] = function(block) {
  let code = "MOTOsetspeed(30)\nMOTOrigid16(40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,0,0,0)\nMOTOsetspeed(30)\nMOTOmove19(86, 105, 100, 99, 92, 56, 123, 100, 105, 95, 100, 100, 106, 144, 75, 99, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(86, 105, 100, 93, 93, 55, 123, 86, 105, 95, 100, 93, 106, 143, 75, 89, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(15)\nMOTOmove19(86, 105, 100, 90, 125, 100, 117, 91, 105, 95, 100, 95, 106, 143, 75, 88, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(15)\nMOTOmove19(86, 105, 100, 88, 120, 27, 190, 80, 105, 95, 100, 94, 139, 114, 111, 85, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(86, 105, 100, 88, 130, 39, 178, 87, 105, 95, 100, 94, 125, 92, 130, 87, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(86, 105, 100, 106, 136, 38, 169, 108, 105, 95, 100, 110, 146, 148, 130, 107, 0, 0, 100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(10)\nMOTOmove19(86, 105, 100, 106, 136, 38, 165, 107, 105, 95, 100, 110, 136, 148, 112, 107, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(86, 105, 100, 106, 142, 49, 151, 111, 105, 95, 100, 110, 132, 148, 101, 116, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(15)\nMOTOmove19(86, 105, 100, 106, 142, 39, 151, 114, 105, 95, 100, 110, 123, 136, 130, 111, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(15)\nMOTOmove19(86, 105, 100, 108, 85, 49, 125, 114, 105, 95, 100, 121, 94, 111, 93, 115, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(86, 105, 100, 100, 93, 55, 123, 106, 105, 95, 100, 99, 106, 143, 75, 109, 0, 0, 100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(86, 105, 100, 100, 93, 55, 123, 100, 105, 95, 100, 99, 106, 143, 75, 99, 0, 0, 100)\nMOTOwait()\nDelayMs(100)\n";
  return code;
}

Blockly.Python['1709615230198'] = function(block) {
  let code = "base_action.action('下一')\n";
  return code;
}

Blockly.Blocks['Squat'] = {
  init: function () {
    this.jsonInit({
      type: 'Squat',
      message0: '%{BKY_SQUAT}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Squat'] = function (block) {
  const code = [
    'MOTOrigid16(40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40)',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 130, 130, 77, 100, 120, 170, 100, 100, 70, 70, 123, 100)',
    'MOTOwait()',
    'DelayMs(500)',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Squat'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['SQUAT'] + "')\n";
  return code;
}

Blockly.Blocks['color_rgbhsv_central_coordinate'] = {
  init: function () {
    this.jsonInit({
      type: 'color_rgbhsv_central_coordinate',
      message0:
        '%1 %{BKY_CAMERA} %2 %{BKY_COLOR_RGBHSV_DISCRIMIATION_TITLE_1} %3 %4 %{BKY_COLOR_RGBHSV_DISCRIMIATION_TITLE_2} %5 Hmin: %6 ~Hmax: %7 %8 Smin :  %9 ~Smax :  %10 %11 Vmin : %12 ~Vmax: %13',
      args0: [
        { type: 'field_dropdown', name: 'camera', options: cameraOptions() },
        { type: 'input_dummy' },
        {
          type: 'field_dropdown',
          name: 'axis',
          options: [
            ['X%{BKY_COORDINATES}', '0'],
            ['Y%{BKY_COORDINATES}', '1'],
          ],
        },
        { type: 'input_dummy' },
        { type: 'input_dummy' },
        hsvArgs.hmin,
        hsvArgs.hmax,
        { type: 'input_dummy' },
        hsvArgs.smin,
        hsvArgs.smax,
        { type: 'input_dummy' },
        hsvArgs.vmin,
        hsvArgs.vmax,
      ],
      output: 'Number',
      colour: Blockly.Msg.VisualHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['color_rgbhsv_central_coordinate'] = undefined

Blockly.Python['color_rgbhsv_central_coordinate'] = function (block) {
  const camera = block.getFieldValue('camera');
  const axis = block.getFieldValue('axis');
  const hmin = block.getFieldValue('hmin');
  const hmax = block.getFieldValue('hmax');
  const smin = block.getFieldValue('smin');
  const smax = block.getFieldValue('smax');
  const vmin = block.getFieldValue('vmin');
  const vmax = block.getFieldValue('vmax');
  const hsvCode = generateHsvCode(GET_CENTRAL_COORDINATE, camera, {
    hmin,
    hmax,
    smin,
    smax,
    vmin,
    vmax,
  });
  const code = `${hsvCode}[${axis}]`;
  return [code, Blockly.Python.ORDER_NONE];
}

Blockly.Blocks['color_identification_rgbhsv'] = {
  init: function () {
    this.jsonInit({
      type: 'color_identification_rgbhsv',
      message0: '%{BKY_VISUAL_COLOR_RGBHSV_TITLE_1}',
      args0: [
        { type: 'field_dropdown', name: 'camera', options: cameraOptions() },
        { type: 'field_colour', name: 'colour', colour: '#ff0000' },
        { type: 'input_dummy' },
        { type: 'input_dummy' },
        hsvArgs.hmin,
        hsvArgs.hmax,
        { type: 'input_dummy' },
        hsvArgs.smin,
        hsvArgs.smax,
        { type: 'input_dummy' },
        hsvArgs.vmin,
        hsvArgs.vmax,
      ],
      previousStatement: null,
      nextStatement: null,
      colour: Blockly.Msg.VisualHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['color_identification_rgbhsv'] = undefined

Blockly.Python['color_identification_rgbhsv'] = function (block) {
  const camera = block.getFieldValue('camera');
  const colour = block.getFieldValue('colour');
  const { hmin, hmax, smin, smax, vmin, vmax } = getHsvRangeParams(block);
  return `# HSVMarker('${camera}', '${colour}', {${hmin}, ${hmax}, ${smin}, ${smax}, ${vmin}, ${vmax}})\n`;
}

Blockly.Blocks['aelos_if'] = {
  init: function () {
    this.jsonInit({
      type: 'aelos_if',
      message0: '%{BKY_AELOS_IF} %1 %{BKY_AELOS_DO} %2',
      args0: [
        {
          type: 'input_value',
          name: 'condition',
          check: 'Boolean',
        },
        {
          type: 'input_statement',
          name: 'do',
        },
      ],
      previousStatement: null,
      nextStatement: null,
      colour: '#86C113',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['aelos_if'] = function(block) {
  var condition = Blockly.Lua.valueToCode(block, "condition", Blockly.Lua.ORDER_NONE) || "false";
  var do_code = Blockly.Lua.statementToCode(block, "do");

  var code = `if ${condition} then \n${do_code}\nHKEY()\nend\n`;
  return code;
}

Blockly.Python['aelos_if'] = function (block) {
  const condition =
    Blockly.Python.valueToCode(block, 'condition', Blockly.Python.ORDER_NONE) || 'False';
  const do_code = Blockly.Python.statementToCode(block, 'do') || Blockly.Python.PASS;

  const code = `if ${condition}:\n${do_code}`;
  return code;
}

Blockly.Blocks['aelos_while'] = {
  init: function () {
    this.jsonInit({
      type: 'aelos_while',
      message0: '%{BKY_AELOS_WHILE} %1 %{BKY_AELOS_DO} %2',
      args0: [
        {
          type: 'input_value',
          name: 'condition',
          check: 'Boolean',
        },
        {
          type: 'input_statement',
          name: 'do',
        },
      ],
      previousStatement: null,
      nextStatement: null,
      colour: '#86C113',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['aelos_while'] = function(block) {
    var condition = Blockly.Lua.valueToCode(block, "condition", Blockly.Lua.ORDER_NONE) || "FALSE";
    var do_code = Blockly.Lua.statementToCode(block, "do") || "  pass\n";

    var code = `while (${condition})\ndo\n${do_code}\nHKEY()\nend\n`;
    return code;
}

Blockly.Python['aelos_while'] = function (block) {
  var condition =
    Blockly.Python.valueToCode(block, 'condition', Blockly.Python.ORDER_NONE) || 'False';
  var do_code = Blockly.Python.statementToCode(block, 'do') || Blockly.Python.PASS;

  var code = `while ${condition}:\n${do_code}`;
  return code;
}

Blockly.Blocks['color_central_coordinate'] = {
  init: function () {
    this.jsonInit({
      type: 'color_central_coordinate',
      message0: '%1 %{BKY_CAMERA} %{BKY_READ} %2 %{BKY_COLOR_CENTRAL_COORDINATE_TITLE} %3',
      args0: [
        { type: 'field_dropdown', name: 'camera', options: cameraOptions() },
        { type: 'field_dropdown', name: 'color', options: colorOptions() },
        {
          type: 'field_dropdown',
          name: 'axis',
          options: [
            ['X%{BKY_COORDINATES}', '0'],
            ['Y%{BKY_COORDINATES}', '1'],
          ],
        },
      ],
      output: 'Number',
      colour: Blockly.Msg.VisualHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['color_central_coordinate'] = undefined

Blockly.Python['color_central_coordinate'] = function (block) {
  const camera = block.getFieldValue('camera');
  const color = block.getFieldValue('color');
  const axis = block.getFieldValue('axis');
  const hsvCode = generateHsvCode(GET_CENTRAL_COORDINATE, camera, hsvMap[color]);
  const code = `${hsvCode}[${axis}]`;
  return [code, Blockly.Python.ORDER_NONE];
}

Blockly.Blocks['detect_label_camera_y'] = {
  init: function () {
    this.jsonInit({
      type: 'detect_label_camera_y',
      message0: '%{BKY_DETECT_LABEL_CAMERA_Y_TITLE}',
      args0: [
        { type: 'field_dropdown', name: 'camera', options: cameraOptions() },
        artagIdOptions,
        { type: 'input_dummy' },
        { type: 'input_dummy' },
        {
          type: 'field_number',
          name: 'Ymin',
          value: 0,
          min: -1,
          max: 1,
          precision: 0.001,
        },
        {
          type: 'field_number',
          name: 'Ymax',
          value: 0,
          min: -1,
          max: 1,
          precision: 0.001,
        },
      ],
      output: 'Boolean',
      colour: Blockly.Msg.VisualHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['detect_label_camera_y'] = undefined

Blockly.Python['detect_label_camera_y'] = function (block) {
  const camera = block.getFieldValue('camera');
  const number = block.getFieldValue('number');
  const min = block.getFieldValue('Ymin');
  const max = block.getFieldValue('Ymax');
  const code = `artag_port.get_y_position('${camera}', ${number}, ${min}, ${max})`;
  return [code, Blockly.Python.ORDER_NONE];
}

Blockly.Blocks['color_discrimination'] = {
  init: function () {
    this.jsonInit({
      type: 'color_discrimination',
      message0: '%1 %{BKY_CAMERA} %{BKY_VISUAL_COLOR_DETECTED} %2',
      args0: [
        { type: 'field_dropdown', name: 'camera', options: cameraOptions() },
        { type: 'field_dropdown', name: 'color', options: colorOptions() },
      ],
      output: 'Boolean',
      colour: Blockly.Msg.VisualHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['color_discrimination'] = undefined

Blockly.Python['color_discrimination'] = function (block) {
  const color = block.getFieldValue('color');
  const camera = block.getFieldValue('camera');
  const code = generateHsvCode(HAVE_COLOR, camera, hsvMap[color]);
  return [code, Blockly.Python.ORDER_NONE];
}

Blockly.Blocks['music'] = {
  init: function () {
    this.jsonInit({
      type: 'music',
      message0: '%{BKY_AELOS_MUSIC} %1',
      args0: [
        {
          type: 'field_input',
          name: 'music_name',
          text: '%{BKY_DEFAULT_MUSIC_INPUT}',
          spellcheck: false,
        },
      ],
      previousStatement: null,
      nextStatement: null,
      colour: Blockly.Msg.ControlHUE,
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['music'] = undefined

Blockly.Python['music'] = function (block) {
  const music_name = block.getFieldValue('music_name');
  let code = `music.music_play(None)\n`;

  if (music_name && music_name !== Blockly.Msg['DEFAULT_MUSIC_INPUT']) {
    code = `music.music_play('${music_name}')\n`;
  }

  return code;
}

Blockly.Blocks['read_distance'] = {
  init: function () {
    this.jsonInit({
      type: 'read_distance',
      message0: '%{BKY_READ_DISTANCE_TITLE_5}',
      args0: [
        { type: 'field_dropdown', name: 'camera', options: cameraOptions() },
        artagIdOptions,
        {
          type: 'field_dropdown',
          name: 'axis',
          options: [
            ['X', artagOptions.x.lable],
            ['Y', artagOptions.y.lable],
          ],
        },
      ],
      output: 'Number',
      colour: Blockly.Msg.VisualHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['read_distance'] = undefined

Blockly.Python['read_distance'] = function (block) {
  const camera = block.getFieldValue('camera');
  const number = block.getFieldValue('number');
  const axis = block.getFieldValue('axis');
  const code = `${GET_SPECIFIES_TAG}(${number}, '${camera}')[${artagOptions[axis].value}]`;
  return [code, Blockly.Python.ORDER_NONE];
}

Blockly.Blocks['delayed'] = {
  init: function () {
    this.jsonInit({
      type: 'delayed',
      message0: '%{BKY_DELAY} %1 %{BKY_SECOND_DELAY_TIME}',
      args0: [
        {
          type: 'field_number',
          name: 'time',
          value: 0,
          min: 0,
          max: 5000,
          precision: 0.1,
        },
      ],
      previousStatement: null,
      nextStatement: null,
      colour: Blockly.Msg.ControlHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['delayed'] = undefined

Blockly.Python['delayed'] = function (block) {
  const time = block.getFieldValue('time') || 0;
  Blockly.Python.definitions_['import_time'] = 'import time';
  const code = `time.sleep(${time})\n`;
  return code;
}

Blockly.Blocks['aelos_if_else'] = {
  init: function () {
    this.jsonInit({
      type: 'aelos_if_else',
      message0: '%{BKY_AELOS_IF} %1 %{BKY_AELOS_DO} %2 %{BKY_AELOS_ELSE} %3',
      args0: [
        {
          type: 'input_value',
          name: 'condition',
          check: 'Boolean',
        },
        {
          type: 'input_statement',
          name: 'if_do',
        },
        {
          type: 'input_statement',
          name: 'else_do',
        },
      ],
      previousStatement: null,
      nextStatement: null,
      colour: '#86C113',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['aelos_if_else'] = function(block) {
  var condition = Blockly.Lua.valueToCode(block, "condition", Blockly.Lua.ORDER_NONE) || "false";
  var if_do = Blockly.Lua.statementToCode(block, "if_do");
  var else_do = Blockly.Lua.statementToCode(block, "else_do");

  var code = `if ${condition} then \n${if_do} \nHKEY()\nelse \n${else_do}\nHKEY()\nend\n`;
  return code;
}

Blockly.Python['aelos_if_else'] = function (block) {
  const condition =
    Blockly.Python.valueToCode(block, 'condition', Blockly.Python.ORDER_NONE) || 'False';
  const if_do = Blockly.Python.statementToCode(block, 'if_do') || Blockly.Python.PASS;
  const else_do = Blockly.Python.statementToCode(block, 'else_do') || Blockly.Python.PASS;

  const code = `if ${condition}:\n${if_do}else:\n${else_do}`;
  return code;
}

Blockly.Blocks['aelos_compare'] = {
  init: function () {
    this.jsonInit({
      type: 'aelos_compare',
      message0: '%1 %2 %3',
      args0: [
        {
          type: 'input_value',
          name: 'input_1',
          check: ['Number', 'Variable', 'Remote_type'],
        },
        {
          type: 'field_dropdown',
          name: 'OP',
          options: [
            ['=', 'JNE'],
            ['\u2260', 'JE'],
            ['<', 'JAE'],
            ['\u200f\u2265\u200f', 'JA'],
            ['>', 'JBE'],
            ['\u200f\u2264\u200f', 'JB'],
          ],
        },
        {
          type: 'input_value',
          name: 'input_2',
          check: ['Number', 'Variable', 'Remote_type'],
        },
      ],
      inputsInline: true,
      output: 'Boolean',
      outputShape: Blockly.OUTPUT_SHAPE_HEXAGONAL,
      colour: '#86C113',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['aelos_compare'] = function(block) {
  var op_map = {
    "JNE": "==",
    "JE": "~=",
    "JAE": "<",
    "JA": "<=",
    "JBE": ">",
    "JB": ">="
  };
  var input_1 = Blockly.Lua.valueToCode(block, "input_1", Blockly.Lua.ORDER_ATOMIC);
  var input_2 = Blockly.Lua.valueToCode(block, "input_2", Blockly.Lua.ORDER_ATOMIC);
  var operation = op_map[block.getFieldValue("OP")];
  var code = "";

  if (input_1 && input_2) {
    code = `${input_1} ${operation} ${input_2}`;
  } else {
    code = "FALSE";
  }

  return [code, Blockly.Lua.ORDER_NONE];
}

Blockly.Python['aelos_compare'] = function (block) {
  const op_map = {
    JNE: '==',
    JE: '!=',
    JAE: '<',
    JA: '<=',
    JBE: '>',
    JB: '>=',
  };
  const input_1 = Blockly.Python.valueToCode(block, 'input_1', Blockly.Python.ORDER_ATOMIC);
  const input_2 = Blockly.Python.valueToCode(block, 'input_2', Blockly.Python.ORDER_ATOMIC);
  const operation = op_map[block.getFieldValue('OP')];
  let code = '';

  if (input_1 && input_2) {
    code = `${input_1} ${operation} ${input_2}`;
  } else {
    code = 'False';
  }

  return [code, Blockly.Python.ORDER_NONE];
}

Blockly.Blocks['Pan_left_1_step'] = {
  init: function () {
    this.jsonInit({
      type: 'Pan_left_1_step',
      message0: '%{BKY_PAN_LEFT_1_STEP}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Pan_left_1_step'] = function (block) {
  const code = [
    'MOTOrigid16(30,30,30,45,65,65,65,65,30,30,30,45,65,65,65,65)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOrigid16(20,20,20,85,85,95,85,85,20,20,20,85,85,95,85,85)',
    'MOTOsetspeed(20)',
    'MOTOmove16(80, 55, 100, 90, 93, 54, 124, 90, 120, 175, 100, 110, 107, 146, 76, 100)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(20)',
    'MOTOmove16(80, 55, 100, 95, 93, 54, 124, 105, 120, 175, 100, 106, 107, 146, 76, 115)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOrigid16(20,20,20,85,85,95,85,85,20,20,20,85,55,55,55,85)',
    'MOTOsetspeed(20)',
    'MOTOmove16(80, 25, 100, 106, 93, 54, 124, 110, 120, 145, 100, 115, 107, 146, 76, 115)',
    'MOTOwait()',
    'MOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Pan_left_1_step'] = function (block) {
  var code = "base_action.action('" + Blockly.Msg['PAN_LEFT_1_STEP'] + "')\n";
  return code;
}

Blockly.Blocks['Pan_right_1_step'] = {
  init: function () {
    this.jsonInit({
      type: 'Pan_right_1_step',
      message0: '%{BKY_PAN_RIGHT_1_STEP}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Pan_right_1_step'] = function (block) {
  const code = [
    'MOTOrigid16(30,30,30,45,65,65,65,65,30,30,30,45,65,65,65,65)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOrigid16(20,20,20,85,85,95,85,85,20,20,20,85,85,95,85,85)',
    'MOTOsetspeed(20)',
    'MOTOmove16(80, 25, 100, 90, 93, 54, 124, 100, 120, 145, 100, 110, 107, 146, 76, 110)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(20)',
    'MOTOmove16(80, 25, 100, 94, 93, 54, 124, 85, 120, 145, 100, 105, 107, 146, 76, 95)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)',
    'MOTOsetspeed(20)',
    'MOTOmove16(80, 55, 100, 85, 93, 54, 124, 85, 120, 175, 100, 94, 107, 146, 76, 90)',
    'MOTOwait()',
    'MOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Pan_right_1_step'] = function (block) {
  var code = "base_action.action('" + Blockly.Msg['PAN_RIGHT_1_STEP'] + "')\n";
  return code;
}

Blockly.Blocks['color_area'] = {
  init: function () {
    this.jsonInit({
      type: 'color_area',
      message0: '%1 %{BKY_CAMERA} %{BKY_VISUAL_COLOR_AREA_READ} %2 %{BKY_VISUAL_COLOR_AREA_RATIO}',
      args0: [
        { type: 'field_dropdown', name: 'camera', options: cameraOptions() },
        { type: 'field_dropdown', name: 'color', options: colorOptions() },
      ],
      output: 'Number',
      colour: Blockly.Msg.VisualHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['color_area'] = undefined

Blockly.Python['color_area'] = function (block) {
  const camera = block.getFieldValue('camera');
  const color = block.getFieldValue('color');
  const code = generateHsvCode(GET_COLOR_PERCENT, camera, hsvMap[color]);
  return [code, Blockly.Python.ORDER_NONE];
}

Blockly.Blocks['Outstretched_hands'] = {
  init: function () {
    this.jsonInit({
      type: 'Outstretched_hands',
      message0: '%{BKY_OUTSTRETCHED_HANDS}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Outstretched_hands'] = function (block) {
  const code = [
    'MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)',
    'MOTOsetspeed(68)',
    'MOTOmove16(76, 11, 190, 100, 93, 55, 124, 99, 124, 189, 10, 100, 107, 145, 76, 101)',
    'MOTOwait()',
    'DelayMs(200)',
    'MOTOsetspeed(40)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Outstretched_hands'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['OUTSTRETCHED_HANDS'] + "')\n";
  return code;
}

Blockly.Blocks['Turn_left_1_step'] = {
  init: function () {
    this.jsonInit({
      type: 'Turn_left_1_step',
      message0: '%{BKY_TURN_LEFT_1_STEP}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Turn_left_1_step'] = function (block) {
  const code = [
    'MOTOrigid16(30,30,30,65,65,65,65,65,30,30,30,65,65,65,65,65)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(24)',
    'MOTOmove16(80, 30, 115, 95, 63, 55, 94, 95, 120, 170, 115, 105, 77, 145, 46, 105)',
    'MOTOwait()',
    'MOTOsetspeed(24)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Turn_left_1_step'] = function (block) {
  var code = "base_action.action('" + Blockly.Msg['TURN_LEFT_1_STEP'] + "')\n";
  return code;
}

Blockly.Blocks['Take_a_slow_step_forward'] = {
  init: function () {
    this.jsonInit({
      type: 'Take_a_slow_step_forward',
      message0: '%{BKY_TAKE_A_SLOW_STEP_FORWARD}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Take_a_slow_step_forward'] = function (block) {
  const code = [
    'MOTOrigid16(30,30,30,65,75,80,75,65,30,30,30,65,75,80,75,65)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 35, 100, 90, 91, 48, 129, 88, 120, 165, 100, 94, 107, 146, 76, 89)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 86, 125, 95, 110, 90, 120, 165, 90, 94, 107, 146, 76, 87)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 86, 113, 37, 156, 88, 120, 165, 90, 94, 107, 146, 77, 89)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 35, 90, 107, 100, 56, 124, 111, 120, 165, 90, 112, 129, 155, 93, 110)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 110, 106, 95, 54, 123, 113, 120, 165, 110, 114, 75, 105, 90, 110)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 110, 106, 93, 54, 123, 111, 120, 165, 110, 114, 87, 163, 44, 112)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 35, 110, 88, 71, 45, 107, 90, 120, 165, 110, 93, 100, 144, 76, 89)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 86, 110, 95, 100, 90, 120, 165, 90, 94, 107, 146, 77, 89)',
    'MOTOwait()',
    'MOTOsetspeed(20)',
    'MOTOmove16(80, 35, 100, 90, 91, 48, 129, 88, 120, 165, 100, 94, 107, 146, 76, 89)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Take_a_slow_step_forward'] = function (block) {
  var code = "base_action.action('" + Blockly.Msg['TAKE_A_SLOW_STEP_FORWARD'] + "')\n";
  return code;
}

Blockly.Blocks['1709625670429'] = {
  init: function() {
    this.jsonInit({
      "type": "1709625670429",
      "message0": "抓",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709625670429'] = function(block) {
  let code = "MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)\nMOTOsetspeed(68)\nMOTOmove19(76,30,190,100,93,55,124,99,124,170,10,100,107,145,76,101,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(40)\nMOTOmove19(80,30,100,100,93,55,124,100,120,170,100,100,107,145,76,100,128,71,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709625670429'] = function(block) {
  let code = "base_action.action('抓')\n";
  return code;
}

Blockly.Blocks['1709626253292'] = {
  init: function() {
    this.jsonInit({
      "type": "1709626253292",
      "message0": "抓取",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709626253292'] = function(block) {
  let code = "MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)\nMOTOsetspeed(68)\nMOTOmove19(76,30,190,100,93,55,124,99,124,170,10,100,107,145,76,101,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(14)\nMOTOmove19(80,30,160,100,130,130,77,100,120,170,40,100,70,70,123,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(14)\nMOTOmove19(80,10,160,100,130,130,77,100,120,190,40,100,70,70,123,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(15)\nMOTOmove19(80,10,160,100,93,55,124,100,120,190,40,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709626253292'] = function(block) {
  let code = "base_action.action('抓取')\n";
  return code;
}

Blockly.Blocks['1709626458267'] = {
  init: function() {
    this.jsonInit({
      "type": "1709626458267",
      "message0": "抓",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709626458267'] = function(block) {
  let code = "MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)\nMOTOsetspeed(68)\nMOTOmove19(76,30,160,100,93,55,124,99,124,170,40,100,107,145,76,101,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(14)\nMOTOmove19(80,30,160,100,130,130,77,100,120,170,40,100,70,70,123,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(14)\nMOTOmove19(80,10,160,100,130,130,77,100,120,190,40,100,70,70,123,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(15)\nMOTOmove19(80,10,160,100,93,55,124,100,120,190,40,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709626458267'] = function(block) {
  let code = "base_action.action('抓')\n";
  return code;
}

Blockly.Blocks['1709626574492'] = {
  init: function() {
    this.jsonInit({
      "type": "1709626574492",
      "message0": "抓取",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709626574492'] = function(block) {
  let code = "MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)\nMOTOsetspeed(100)\nMOTOmove19(76,30,160,100,93,55,124,99,124,170,40,100,107,145,76,101,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(20)\nMOTOmove19(80,30,160,100,130,130,77,100,120,170,40,100,70,70,123,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(40)\nMOTOmove19(80,10,160,100,130,130,77,100,120,190,40,100,70,70,123,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(15)\nMOTOmove19(80,10,160,100,93,55,124,100,120,190,40,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709626574492'] = function(block) {
  let code = "base_action.action('抓取')\n";
  return code;
}

Blockly.Blocks['1709627633069'] = {
  init: function() {
    this.jsonInit({
      "type": "1709627633069",
      "message0": "抓物左移",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709627633069'] = function(block) {
  let code = "MOTOrigid16(30,30,30,45,65,65,65,65,30,30,30,45,65,65,65,65)\nMOTOsetspeed(30)\nMOTOmove19(80,10,160,100,93,55,124,100,190,40,100,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOrigid16(20,20,20,85,85,95,85,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(20)\nMOTOmove19(80,10,160,90,93,54,124,100,190,40,100,110,107,146,76,110,0,0,100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(20)\nMOTOmove19(80,10,160,94,93,54,124,85,190,40,100,105,107,146,76,95,0,0,100)\nMOTOwait()\nDelayMs(100)\nMOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(20)\nMOTOmove19(80,10,160,85,93,54,124,85,190,40,100,94,107,146,76,90,0,0,100)\nMOTOwait()\nMOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(10)\nMOTOmove19(80,10,160,100,93,55,124,100,190,40,100,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709627633069'] = function(block) {
  let code = "base_action.action('抓物左移')\n";
  return code;
}

Blockly.Blocks['1709627876992'] = {
  init: function() {
    this.jsonInit({
      "type": "1709627876992",
      "message0": "抓",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709627876992'] = function(block) {
  let code = "MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)\nMOTOsetspeed(100)\nMOTOmove19(80,30,160,100,93,55,124,100,120,170,40,100,107,145,76,101,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(20)\nMOTOmove19(80,30,160,100,130,130,77,100,120,170,40,100,70,70,123,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(40)\nMOTOmove19(80,10,160,100,130,130,77,100,120,190,40,100,70,70,123,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(15)\nMOTOmove19(80,10,160,100,93,55,124,100,120,190,40,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709627876992'] = function(block) {
  let code = "base_action.action('抓')\n";
  return code;
}

Blockly.Blocks['1709628009779'] = {
  init: function() {
    this.jsonInit({
      "type": "1709628009779",
      "message0": "左移",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709628009779'] = function(block) {
  let code = "MOTOrigid16(30,30,30,45,65,65,65,65,30,30,30,45,65,65,65,65)\nMOTOsetspeed(30)\nMOTOmove19(80,10,160,100,93,55,124,100,120,190,40,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOrigid16(20,20,20,85,85,95,85,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(20)\nMOTOmove19(80,10,160,90,93,54,124,100,120,190,40,110,107,146,76,110,0,0,100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(20)\nMOTOmove19(80,10,160,94,93,54,124,85,120,190,40,105,107,146,76,95,0,0,100)\nMOTOwait()\nDelayMs(100)\nMOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(20)\nMOTOmove19(80,10,160,85,93,54,124,85,120,190,40,94,107,146,76,90,0,0,100)\nMOTOwait()\nMOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(10)\nMOTOmove19(80,10,160,100,93,55,124,100,120,190,40,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709628009779'] = function(block) {
  let code = "base_action.action('左移')\n";
  return code;
}

Blockly.Blocks['1709628230208'] = {
  init: function() {
    this.jsonInit({
      "type": "1709628230208",
      "message0": "抓取",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709628230208'] = function(block) {
  let code = "MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)\nMOTOsetspeed(100)\nMOTOmove19(80,30,160,100,93,55,124,100,120,170,40,100,107,145,76,101,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(20)\nMOTOmove19(80,30,160,100,130,130,77,100,120,170,40,100,70,70,123,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(40)\nMOTOmove19(75,10,160,100,130,130,77,100,125,190,40,100,70,70,123,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(15)\nMOTOmove19(75,10,160,100,93,55,124,100,125,190,40,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709628230208'] = function(block) {
  let code = "base_action.action('抓取')\n";
  return code;
}

Blockly.Blocks['1709628350053'] = {
  init: function() {
    this.jsonInit({
      "type": "1709628350053",
      "message0": "抓物左移",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709628350053'] = function(block) {
  let code = "MOTOrigid16(30,30,30,45,65,65,65,65,30,30,30,45,65,65,65,65)\nMOTOsetspeed(30)\nMOTOmove19(75,10,160,100,93,55,124,100,125,190,40,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOrigid16(20,20,20,85,85,95,85,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(20)\nMOTOmove19(75,10,160,90,93,54,124,100,125,190,40,110,107,146,76,110,0,0,100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(20)\nMOTOmove19(75,10,160,94,93,54,124,85,125,190,40,105,107,146,76,95,0,0,100)\nMOTOwait()\nDelayMs(100)\nMOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(20)\nMOTOmove19(75,10,160,85,93,54,124,85,125,190,40,94,107,146,76,90,0,0,100)\nMOTOwait()\nMOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(10)\nMOTOmove19(75,10,160,100,93,55,124,100,125,190,40,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709628350053'] = function(block) {
  let code = "base_action.action('抓物左移')\n";
  return code;
}

Blockly.Blocks['1709628579736'] = {
  init: function() {
    this.jsonInit({
      "type": "1709628579736",
      "message0": "放下",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709628579736'] = function(block) {
  let code = "MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)\nMOTOsetspeed(20)\nMOTOmove19(80,30,160,100,130,130,77,100,120,170,40,100,70,70,123,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(40)\nMOTOmove19(75,10,160,100,130,130,77,100,125,190,40,100,70,70,123,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(15)\nMOTOmove19(75,10,160,100,93,55,124,100,125,190,40,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709628579736'] = function(block) {
  let code = "base_action.action('放下')\n";
  return code;
}

Blockly.Blocks['1709628725005'] = {
  init: function() {
    this.jsonInit({
      "type": "1709628725005",
      "message0": "放",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709628725005'] = function(block) {
  let code = "MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)\nMOTOsetspeed(20)\nMOTOmove19(80,30,160,100,130,130,77,100,120,170,40,100,70,70,123,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(30)\nMOTOmove19(80,30,100,100,93,55,124,100,120,170,100,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709628725005'] = function(block) {
  let code = "base_action.action('放')\n";
  return code;
}

Blockly.Blocks['Touch_head'] = {
  init: function () {
    this.jsonInit({
      type: 'Touch_head',
      message0: '%{BKY_TOUCH_HEAD}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Touch_head'] = function (block) {
  const code = [
    'MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(81, 30, 100, 99, 93, 57, 124, 101, 90, 50, 101, 101, 107, 146, 77, 101)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(81, 30, 100, 99, 93, 57, 124, 101, 45, 50, 100, 101, 107, 146, 77, 101)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(81, 30, 100, 99, 93, 57, 124, 101, 90, 50, 101, 101, 107, 146, 77, 101)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(81, 30, 100, 99, 93, 57, 124, 101, 45, 50, 100, 101, 107, 146, 77, 101)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(81, 30, 100, 99, 93, 57, 124, 101, 90, 50, 101, 101, 107, 146, 77, 101)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(81, 30, 100, 99, 93, 57, 124, 101, 45, 50, 100, 101, 107, 146, 77, 101)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(81, 30, 100, 99, 93, 57, 124, 101, 90, 50, 101, 101, 107, 146, 77, 101)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(81, 30, 100, 99, 93, 57, 124, 101, 45, 50, 100, 101, 107, 146, 77, 101)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(81, 30, 100, 99, 93, 57, 124, 101, 90, 50, 101, 101, 107, 146, 77, 101)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(81, 30, 100, 99, 93, 57, 124, 101, 45, 50, 100, 101, 107, 146, 77, 101)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(81, 30, 100, 99, 93, 57, 124, 101, 90, 50, 101, 101, 107, 146, 77, 101)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(81, 30, 100, 99, 93, 57, 124, 101, 45, 50, 100, 101, 107, 146, 77, 101)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(81, 30, 100, 99, 93, 57, 124, 101, 90, 50, 101, 101, 107, 146, 77, 101)',
    'MOTOwait()',
    'DelayMs(600)',
    'MOTOsetspeed(35)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Touch_head'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['TOUCH_HEAD'] + "')\n";
  return code;
}

Blockly.Blocks['color_rgbhsv_area'] = {
  init: function () {
    this.jsonInit({
      type: 'color_rgbhsv_area',
      message0:
        '%1 %{BKY_VISUAL_COLOR_RGBHSV_AREA_TITLE_1} %2 %{BKY_VISUAL_COLOR_RGBHSV_AREA_TITLE_2} %3 Hmin: %4 ~Hmax: %5 %6 Smin :  %7 ~Smax :  %8 %9 Vmin : %10 ~Vmax: %11',
      args0: [
        { type: 'field_dropdown', name: 'camera', options: cameraOptions() },
        { type: 'input_dummy' },
        { type: 'input_dummy' },
        hsvArgs.hmin,
        hsvArgs.hmax,
        { type: 'input_dummy' },
        hsvArgs.smin,
        hsvArgs.smax,
        { type: 'input_dummy' },
        hsvArgs.vmin,
        hsvArgs.vmax,
      ],
      output: 'Number',
      colour: Blockly.Msg.VisualHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['color_rgbhsv_area'] = undefined

Blockly.Python['color_rgbhsv_area'] = function (block) {
  const camera = block.getFieldValue('camera');
  const hmin = block.getFieldValue('hmin');
  const hmax = block.getFieldValue('hmax');
  const smin = block.getFieldValue('smin');
  const smax = block.getFieldValue('smax');
  const vmin = block.getFieldValue('vmin');
  const vmax = block.getFieldValue('vmax');
  const code = generateHsvCode(GET_COLOR_PERCENT, camera, { hmin, hmax, smin, smax, vmin, vmax });
  return [code, Blockly.Python.ORDER_NONE];
}

Blockly.Blocks['color_rgbhsv_position'] = {
  init: function () {
    this.jsonInit({
      type: 'color_rgbhsv_position',
      message0:
        '%1 %{BKY_CAMERA} %2 %{BKY_COLOR_RGBHSV_POSITION_TITLE_1} %3 %4 %{BKY_COLOR_RGBHSV_POSITION_TITLE_2} %5 Hmin: %6 ~Hmax: %7 %8 Smin :  %9 ~Smax :  %10 %11 Vmin : %12 ~Vmax: %13',
      args0: [
        { type: 'field_dropdown', name: 'camera', options: cameraOptions() },
        { type: 'input_dummy' },
        { type: 'field_dropdown', name: 'rect', options: rectOptions() },
        { type: 'input_dummy' },
        { type: 'input_dummy' },
        hsvArgs.hmin,
        hsvArgs.hmax,
        { type: 'input_dummy' },
        hsvArgs.smin,
        hsvArgs.smax,
        { type: 'input_dummy' },
        hsvArgs.vmin,
        hsvArgs.vmax,
      ],
      output: 'Number',
      colour: Blockly.Msg.VisualHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['color_rgbhsv_position'] = undefined

Blockly.Python['color_rgbhsv_position'] = function (block) {
  const camera = block.getFieldValue('camera');
  const rect = block.getFieldValue('rect');
  const hmin = block.getFieldValue('hmin');
  const hmax = block.getFieldValue('hmax');
  const smin = block.getFieldValue('smin');
  const smax = block.getFieldValue('smax');
  const vmin = block.getFieldValue('vmin');
  const vmax = block.getFieldValue('vmax');
  const code = generateHsvCode(GET_FRAME, camera, { hmin, hmax, smin, smax, vmin, vmax }, rect);
  return [code, Blockly.Python.ORDER_NONE];
}

Blockly.Blocks['color_position'] = {
  init: function () {
    this.jsonInit({
      type: 'color_position',
      message0: '%1 %{BKY_CAMERA} %2 %{BKY_READ} %3 %{BKY_COLOR_POSITION_TITLE} %4',
      args0: [
        { type: 'field_dropdown', name: 'camera', options: cameraOptions() },
        { type: 'input_dummy' },
        { type: 'field_dropdown', name: 'color', options: colorOptions() },
        { type: 'field_dropdown', name: 'rect', options: rectOptions() },
      ],
      output: 'Number',
      colour: Blockly.Msg.VisualHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['color_position'] = undefined

Blockly.Python['color_position'] = function (block) {
  const camera = block.getFieldValue('camera');
  const color = block.getFieldValue('color');
  const rect = block.getFieldValue('rect');
  const code = generateHsvCode(GET_FRAME, camera, hsvMap[color], rect);
  return [code, Blockly.Python.ORDER_NONE];
}

Blockly.Blocks['Shake_hand'] = {
  init: function () {
    this.jsonInit({
      type: 'Shake_hand',
      message0: '%{BKY_SHAKE_HAND}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Shake_hand'] = function (block) {
  const code = [
    'MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 141, 181, 38, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(12)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 141, 181, 56, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(12)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 141, 181, 38, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(12)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 141, 181, 56, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(12)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 141, 181, 38, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(12)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 141, 181, 56, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(12)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 141, 181, 38, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(35)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Shake_hand'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['SHAKE_HAND'] + "')\n";
  return code;
}

Blockly.Blocks['1709637036686'] = {
  init: function() {
    this.jsonInit({
      "type": "1709637036686",
      "message0": "录入",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709637036686'] = function(block) {
  let code = "MOTOrigid16(40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40)\nMOTOsetspeed(30)\nMOTOmove19(80,30,99,100,93,56,124,100,120,169,100,100,106,143,76,99,0,0,99)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709637036686'] = function(block) {
  let code = "base_action.action('录入')\n";
  return code;
}

Blockly.Blocks['1709637086961'] = {
  init: function() {
    this.jsonInit({
      "type": "1709637086961",
      "message0": "录入完毕",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709637086961'] = function(block) {
  let code = "MOTOrigid16(40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40)\nMOTOsetspeed(30)\nMOTOmove19(80,30,99,100,93,56,124,100,120,169,45,100,106,143,76,99,0,0,99)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709637086961'] = function(block) {
  let code = "base_action.action('录入完毕')\n";
  return code;
}

Blockly.Blocks['1709637145267'] = {
  init: function() {
    this.jsonInit({
      "type": "1709637145267",
      "message0": "开始录入",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709637145267'] = function(block) {
  let code = "MOTOrigid16(40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40)\nMOTOsetspeed(30)\nMOTOmove19(80,30,99,100,93,56,124,100,120,169,45,100,106,143,76,99,0,0,99)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709637145267'] = function(block) {
  let code = "base_action.action('开始录入')\n";
  return code;
}

Blockly.Blocks['1709637167845'] = {
  init: function() {
    this.jsonInit({
      "type": "1709637167845",
      "message0": "录入结束",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709637167845'] = function(block) {
  let code = "MOTOrigid16(40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40)\nMOTOsetspeed(30)\nMOTOmove19(80,30,99,100,93,56,124,100,120,169,100,100,106,143,76,99,0,0,99)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709637167845'] = function(block) {
  let code = "base_action.action('录入结束')\n";
  return code;
}

Blockly.Blocks['1709637790511'] = {
  init: function() {
    this.jsonInit({
      "type": "1709637790511",
      "message0": "分拣抬手",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709637790511'] = function(block) {
  let code = "MOTOrigid16(40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40)\nMOTOsetspeed(50)\nMOTOmove19(80,100,99,100,93,56,124,100,120,169,100,100,106,143,76,99,0,0,99)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(50)\nMOTOmove19(80,100,190,100,93,56,124,100,120,169,100,100,106,143,76,99,0,0,99)\nMOTOwait()\nDelayMs(50)\nMOTOsetspeed(50)\nMOTOmove19(80,20,190,100,93,56,124,100,120,169,100,100,106,143,76,99,0,0,99)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709637790511'] = function(block) {
  let code = "base_action.action('分拣抬手')\n";
  return code;
}

Blockly.Blocks['1709637961911'] = {
  init: function() {
    this.jsonInit({
      "type": "1709637961911",
      "message0": "分拣落手",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709637961911'] = function(block) {
  let code = "MOTOrigid16(40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40)\nMOTOsetspeed(50)\nMOTOmove19(80,99,190,100,93,56,124,100,120,169,100,100,106,143,76,99,0,0,99)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(50)\nMOTOmove19(80,100,100,100,93,56,124,100,120,169,100,100,106,143,76,99,0,0,99)\nMOTOwait()\nDelayMs(50)\nMOTOsetspeed(30)\nMOTOmove19(80,30,100,100,93,55,124,100,120,170,100,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709637961911'] = function(block) {
  let code = "base_action.action('分拣落手')\n";
  return code;
}

Blockly.Blocks['repeat_until'] = {
  init: function () {
    this.jsonInit({
      type: 'repeat_until',
      message0: '%{BKY_REPEAT_UNTIL} %1 %{BKY_ACTION} %2',
      args0: [
        {
          type: 'input_value',
          name: 'condition',
          check: 'Boolean',
        },
        {
          type: 'input_statement',
          name: 'block',
        },
      ],
      previousStatement: null,
      nextStatement: null,
      colour: '#86C113',
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['repeat_until'] = undefined

Blockly.Python['repeat_until'] = function (block) {
  const blockCode =
    Blockly.Python.valueToCode(block, 'condition', Blockly.Python.ORDER_NONE) || 'False';
  let do_code = Blockly.Python.statementToCode(block, 'block') || Blockly.Python.PASS;
  return `while not ${blockCode}:\n${do_code}`;
}

Blockly.Blocks['color_rgbhsv_position_range'] = {
  init: function () {
    this.jsonInit({
      type: 'color_rgbhsv_position_range',
      message0:
        '%1 %{BKY_CAMERA} %{BKY_VISUAL_RGBHSV_POSITION_RANGE_TITLE_1} %2 %3 %{BKY_VISUAL_RGBHSV_POSITION_RANGE_TITLE_2} %4 Hmin: %5 ~Hmax: %6 %7 Smin :  %8 ~Smax :  %9 %10 Vmin : %11 ~Vmax: %12',
      args0: [
        { type: 'field_dropdown', name: 'camera', options: cameraOptions() },
        { type: 'field_dropdown', name: 'position', options: colorPositionOptions() },
        { type: 'input_dummy' },
        { type: 'input_dummy' },
        hsvArgs.hmin,
        hsvArgs.hmax,
        { type: 'input_dummy' },
        hsvArgs.smin,
        hsvArgs.smax,
        { type: 'input_dummy' },
        hsvArgs.vmin,
        hsvArgs.vmax,
      ],
      output: 'Boolean',
      colour: Blockly.Msg.VisualHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['color_rgbhsv_position_range'] = undefined

Blockly.Python['color_rgbhsv_position_range'] = function (block) {
  const camera = block.getFieldValue('camera');
  const hsvString = getHsvRangeParams(block, true);
  const position = block.getFieldValue('position');
  const code = `colour_port.get_hsv_position('${camera}', '${position}', ${hsvString})`;
  return [code, Blockly.Python.ORDER_NONE];
}

Blockly.Blocks['1709693797258'] = {
  init: function() {
    this.jsonInit({
      "type": "1709693797258",
      "message0": "分拣右移",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709693797258'] = function(block) {
  let code = "MOTOrigid16(30,30,30,45,65,65,65,65,30,30,30,45,65,65,65,65)\nMOTOsetspeed(30)\nMOTOmove19(80,20,190,100,93,55,124,100,120,170,100,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOrigid16(20,20,20,85,85,95,85,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(20)\nMOTOmove19(80,20,190,90,93,54,124,100,120,145,100,110,107,146,76,110,0,0,100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(20)\nMOTOmove19(80,20,190,94,93,54,124,85,120,145,100,105,107,146,76,95,0,0,100)\nMOTOwait()\nDelayMs(100)\nMOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(20)\nMOTOmove19(80,20,190,85,93,54,124,85,120,175,100,94,107,146,76,90,0,0,100)\nMOTOwait()\nMOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(10)\nMOTOmove19(80,20,190,100,93,55,124,100,120,170,100,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709693797258'] = function(block) {
  let code = "base_action.action('分拣右移')\n";
  return code;
}

Blockly.Blocks['1709694023243'] = {
  init: function() {
    this.jsonInit({
      "type": "1709694023243",
      "message0": "分拣",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709694023243'] = function(block) {
  let code = "MOTOrigid16(40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40)\nMOTOsetspeed(50)\nMOTOmove19(80,100,99,100,93,56,124,100,120,169,100,100,106,143,76,99,0,0,99)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(50)\nMOTOmove19(80,100,175,100,93,56,124,100,120,169,100,100,106,143,76,99,0,0,99)\nMOTOwait()\nDelayMs(50)\nMOTOsetspeed(50)\nMOTOmove19(80,20,175,100,93,56,124,100,120,169,100,100,106,143,76,99,0,0,99)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709694023243'] = function(block) {
  let code = "base_action.action('分拣')\n";
  return code;
}

Blockly.Blocks['1709694041562'] = {
  init: function() {
    this.jsonInit({
      "type": "1709694041562",
      "message0": "分拣抬手",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709694041562'] = function(block) {
  let code = "MOTOrigid16(40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40)\nMOTOsetspeed(50)\nMOTOmove19(80,100,99,100,93,56,124,100,120,169,100,100,106,143,76,99,0,0,99)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(50)\nMOTOmove19(80,100,175,100,93,56,124,100,120,169,100,100,106,143,76,99,0,0,99)\nMOTOwait()\nDelayMs(50)\nMOTOsetspeed(50)\nMOTOmove19(80,20,175,100,93,56,124,100,120,169,100,100,106,143,76,99,0,0,99)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709694041562'] = function(block) {
  let code = "base_action.action('分拣抬手')\n";
  return code;
}

Blockly.Blocks['1709694136410'] = {
  init: function() {
    this.jsonInit({
      "type": "1709694136410",
      "message0": "分拣",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709694136410'] = function(block) {
  let code = "MOTOrigid16(30,30,30,45,65,65,65,65,30,30,30,45,65,65,65,65)\nMOTOsetspeed(30)\nMOTOmove19(80,20,175,100,93,55,124,100,120,170,100,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOrigid16(20,20,20,85,85,95,85,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(20)\nMOTOmove19(80,20,175,90,93,54,124,100,120,145,100,110,107,146,76,110,0,0,100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(20)\nMOTOmove19(80,20,175,94,93,54,124,85,120,145,100,105,107,146,76,95,0,0,100)\nMOTOwait()\nDelayMs(100)\nMOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(20)\nMOTOmove19(80,20,175,85,93,54,124,85,120,175,100,94,107,146,76,90,0,0,100)\nMOTOwait()\nMOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(10)\nMOTOmove19(80,20,175,100,93,55,124,100,120,170,100,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709694136410'] = function(block) {
  let code = "base_action.action('分拣')\n";
  return code;
}

Blockly.Blocks['1709694149919'] = {
  init: function() {
    this.jsonInit({
      "type": "1709694149919",
      "message0": "分拣右移",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709694149919'] = function(block) {
  let code = "MOTOrigid16(30,30,30,45,65,65,65,65,30,30,30,45,65,65,65,65)\nMOTOsetspeed(30)\nMOTOmove19(80,20,175,100,93,55,124,100,120,170,100,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOrigid16(20,20,20,85,85,95,85,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(20)\nMOTOmove19(80,20,175,90,93,54,124,100,120,145,100,110,107,146,76,110,0,0,100)\nMOTOwait()\nDelayMs(100)\nMOTOsetspeed(20)\nMOTOmove19(80,20,175,94,93,54,124,85,120,145,100,105,107,146,76,95,0,0,100)\nMOTOwait()\nDelayMs(100)\nMOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(20)\nMOTOmove19(80,20,175,85,93,54,124,85,120,175,100,94,107,146,76,90,0,0,100)\nMOTOwait()\nMOTOrigid16(20,20,20,85,55,55,55,85,20,20,20,85,85,95,85,85)\nMOTOsetspeed(10)\nMOTOmove19(80,20,175,100,93,55,124,100,120,170,100,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709694149919'] = function(block) {
  let code = "base_action.action('分拣右移')\n";
  return code;
}

Blockly.Blocks['aelos_for'] = {
  init: function() {
    this.jsonInit({
      "type": "aelos_for",
      "message0": "%{BKY_AELOS_LOOP} %1 %{BKY_AELOS_LOOP_TIMES} %2 %{BKY_AELOS_DO} %3",
      "args0": [
        {
          "type": "input_value",
          "name": "times",
          "check": ["Number", "Variable"]
        },
        {
          "type": "input_dummy"
        },
        {
          "type": "input_statement",
          "name": "do"
        }
      ],
      "previousStatement": null,
      "nextStatement": null,
      "colour": '#86C113',
      "tooltip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['aelos_for'] = function(block) {
  var times = Blockly.Lua.valueToCode(block, "times", Blockly.Lua.ORDER_NONE) || "0";
  var do_code = Blockly.Lua.statementToCode(block, "do");

  var code = `for i = 1,${times},1\ndo\n${do_code}\nHKEY()\nend\n`;

  return code;
}

Blockly.Python['aelos_for'] = function(block) {
  var times = Blockly.Python.valueToCode(block, "times", Blockly.Python.ORDER_NONE) || "0";
  var do_code = Blockly.Python.statementToCode(block, "do") || Blockly.Python.PASS;

  var code = `for i in range(${times}):\n${do_code}`;

  return code;
}

Blockly.Blocks['Take_a_slow_step_backward'] = {
  init: function () {
    this.jsonInit({
      type: 'Take_a_slow_step_backward',
      message0: '%{BKY_TAKE_A_SLOW_STEP_BACKWARD}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Take_a_slow_step_backward'] = function (block) {
  const code = [
    'MOTOrigid16(30,30,30,65,75,80,75,65,30,30,30,65,75,80,75,65)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 35, 100, 90, 91, 48, 129, 88, 120, 165, 100, 94, 107, 146, 76, 90)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 86, 90, 95, 84, 90, 120, 165, 90, 94, 107, 146, 78, 87)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 110, 88, 71, 53, 105, 85, 120, 165, 110, 93, 100, 144, 79, 91)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 35, 110, 106, 93, 53, 124, 111, 120, 165, 110, 114, 87, 163, 42, 110)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 106, 95, 53, 122, 113, 120, 165, 90, 114, 110, 105, 114, 110)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 107, 100, 56, 121, 109, 120, 165, 90, 112, 129, 147, 95, 115)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 35, 90, 86, 113, 37, 158, 90, 120, 165, 90, 94, 107, 147, 76, 89)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 86, 110, 95, 100, 90, 120, 165, 90, 94, 107, 146, 77, 89)',
    'MOTOwait()',
    'MOTOsetspeed(20)',
    'MOTOmove16(80, 35, 100, 90, 91, 48, 129, 88, 120, 165, 100, 94, 107, 146, 76, 90)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Take_a_slow_step_backward'] = function (block) {
  var code = "base_action.action('" + Blockly.Msg['TAKE_A_SLOW_STEP_BACKWARD'] + "')\n";
  return code;
}

Blockly.Blocks['Scratch_head'] = {
  init: function () {
    this.jsonInit({
      type: 'Scratch_head',
      message0: '%{BKY_SCRATCH_HEAD}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Scratch_head'] = function (block) {
  const code = [
    'MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)',
    'MOTOsetspeed(42)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 35, 60, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 55, 45, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 35, 60, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 55, 45, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 35, 60, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 55, 45, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 35, 60, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 55, 45, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 35, 60, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 55, 45, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 35, 60, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 55, 45, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 35, 60, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 55, 45, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 35, 60, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 55, 45, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(14)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 35, 60, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'DelayMs(200)',
    'MOTOsetspeed(24)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Scratch_head'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['SCRATCH_HEAD'] + "')\n";
  return code;
}

Blockly.Blocks['color_rgbhsv_discrimiation'] = {
  init: function () {
    this.jsonInit({
      type: 'color_rgbhsv_discrimiation',
      message0:
        '%1 %{BKY_CAMERA} %{BKY_VISUAL_COLOR_RGBHSV_DISCRI_TITLE_1} %2 %{BKY_VISUAL_COLOR_RGBHSV_DISCRI_TITLE_2} %3 Hmin: %4 ~Hmax: %5 %6 Smin :  %7 ~Smax :  %8 %9 Vmin : %10 ~Vmax: %11',
      args0: [
        { type: 'field_dropdown', name: 'camera', options: cameraOptions() },
        { type: 'input_dummy' },
        { type: 'input_dummy' },
        hsvArgs.hmin,
        hsvArgs.hmax,
        { type: 'input_dummy' },
        hsvArgs.smin,
        hsvArgs.smax,
        { type: 'input_dummy' },
        hsvArgs.vmin,
        hsvArgs.vmax,
      ],
      output: 'Boolean',
      colour: Blockly.Msg.VisualHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['color_rgbhsv_discrimiation'] = undefined

Blockly.Python['color_rgbhsv_discrimiation'] = function (block) {
  const camera = block.getFieldValue('camera');
  const hmin = block.getFieldValue('hmin');
  const hmax = block.getFieldValue('hmax');
  const smin = block.getFieldValue('smin');
  const smax = block.getFieldValue('smax');
  const vmin = block.getFieldValue('vmin');
  const vmax = block.getFieldValue('vmax');
  const code = generateHsvCode(HAVE_COLOR, camera, { hmin, hmax, smin, smax, vmin, vmax });
  return [code, Blockly.Python.ORDER_NONE];
}

Blockly.Blocks['Stoop_down'] = {
  init: function () {
    this.jsonInit({
      type: 'Stoop_down',
      message0: '%{BKY_STOOP_DOWN}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Stoop_down'] = function (block) {
  const code = [
    'MOTOrigid16(55,55,55,60,60,60,60,60,55,55,55,60,60,60,60,60)',
    'MOTOsetspeed(35)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 95, 112, 101, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(35)',
    'MOTOmove16(101, 97, 101, 100, 93, 55, 124, 100, 95, 112, 101, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(35)',
    'MOTOmove16(101, 97, 101, 100, 93, 55, 124, 100, 182, 112, 101, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(35)',
    'MOTOmove16(12, 97, 101, 100, 93, 55, 124, 100, 182, 112, 101, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(18)',
    'MOTOmove16(12, 97, 101, 98, 114, 55, 133, 100, 182, 112, 101, 102, 86, 145, 67, 100)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(18)',
    'MOTOmove16(12, 97, 101, 100, 93, 55, 124, 100, 182, 112, 101, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(18)',
    'MOTOmove16(12, 97, 101, 98, 114, 55, 133, 100, 182, 112, 101, 102, 86, 145, 67, 100)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(18)',
    'MOTOmove16(12, 97, 101, 100, 93, 56, 124, 100, 182, 112, 101, 100, 107, 145, 77, 101)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(18)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Stoop_down'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['STOOP_DOWN'] + "')\n";
  return code;
}

Blockly.Blocks['Sit'] = {
  init: function () {
    this.jsonInit({
      type: 'Sit',
      message0: '%{BKY_SIT}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Sit'] = function (block) {
  const code = [
    'MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'DelayMs(1500)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 31, 100, 100, 95, 130, 60, 100, 121, 171, 100, 100, 105, 70, 140, 100)',
    'MOTOwait()',
    'DelayMs(3500)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Sit'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['SIT'] + "')\n";
  return code;
}

Blockly.Blocks['Split_goal'] = {
  init: function () {
    this.jsonInit({
      type: 'Split_goal',
      message0: '%{BKY_SPLIT_GOAL}',
      previousStatement: null,
      nextStatement: null,
      colour: '#7148F5',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Split_goal'] = function (block) {
  const code = [
    'MOTOrigid16(25,25,25,70,70,70,70,70,25,25,25,70,70,70,70,70)',
    'MOTOsetspeed(30)',
    'MOTOmove16(100, 100, 100, 20, 128, 133, 59, 65, 100, 100, 100, 180, 72, 67, 141, 135)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(101, 100, 101, 20, 80, 32, 135, 65, 99, 100, 99, 180, 120, 168, 65, 135)',
    'MOTOwait()',
    'DelayMs(600)',
    'MOTOsetspeed(30)',
    'MOTOmove16(100, 100, 100, 20, 128, 133, 59, 65, 100, 100, 100, 180, 72, 67, 141, 135)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(103, 39, 113, 74, 125, 139, 62, 74, 97, 161, 87, 126, 75, 61, 138, 126)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(30)',
    'MOTOmove16(85, 50, 130, 100, 125, 135, 67, 100, 115, 150, 70, 100, 75, 65, 134, 100)',
    'MOTOwait()',
    'DelayMs(100)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 98, 108, 143, 44, 103, 118, 166, 99, 103, 97, 59, 160, 103)',
    'MOTOwait()',
    'DelayMs(250)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Split_goal'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['SPLIT_GOAL'] + "')\n";
  return code;
}

Blockly.Blocks['1709708606075'] = {
  init: function() {
    this.jsonInit({
      "type": "1709708606075",
      "message0": "tmp",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709708606075'] = function(block) {
  let code = "MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)\nMOTOsetspeed(20)\nMOTOmove19(80,30,160,100,130,150,47,100,120,170,40,100,70,50,160,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(20)\nMOTOmove19(80,30,160,100,150,150,47,100,120,170,40,100,50,50,160,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(40)\nMOTOmove19(75,10,160,100,135,150,47,100,125,190,40,100,65,50,160,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(15)\nMOTOmove19(75,10,160,100,93,55,124,100,125,190,40,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709708606075'] = function(block) {
  let code = "base_action.action('tmp')\n";
  return code;
}

Blockly.Blocks['1709709988266'] = {
  init: function() {
    this.jsonInit({
      "type": "1709709988266",
      "message0": "配送抓取",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709709988266'] = function(block) {
  let code = "MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)\nMOTOsetspeed(20)\nMOTOmove19(80,30,140,100,100,150,35,100,120,170,60,100,100,50,165,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(10)\nMOTOmove19(80,30,140,100,120,150,35,100,120,170,60,100,80,50,165,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(40)\nMOTOmove19(50,30,140,100,120,150,35,100,150,170,60,100,80,50,165,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(10)\nMOTOmove19(50,30,140,100,100,150,35,100,150,170,60,100,100,50,165,100,0,0,100)\nMOTOwait()\nDelayMs(200)\nMOTOsetspeed(15)\nMOTOmove19(75,10,180,100,93,55,124,100,125,190,20,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709709988266'] = function(block) {
  let code = "base_action.action('配送抓取')\n";
  return code;
}

Blockly.Blocks['Take_three_slow_steps_forward'] = {
  init: function () {
    this.jsonInit({
      type: 'Take_three_slow_steps_forward',
      message0: '%{BKY_TAKE_THREE_SLOW_STEPS_FORWARD}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Take_three_slow_steps_forward'] = function (block) {
  const code = [
    'MOTOrigid16(30,30,30,65,75,80,75,65,30,30,30,65,75,80,75,65)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 35, 100, 90, 91, 48, 129, 88, 120, 165, 100, 94, 107, 146, 76, 89)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 86, 125, 95, 110, 90, 120, 165, 90, 94, 107, 146, 76, 87)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 86, 113, 37, 156, 88, 120, 165, 90, 94, 107, 146, 77, 89)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 35, 90, 107, 100, 56, 124, 111, 120, 165, 90, 112, 129, 155, 93, 110)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 110, 106, 95, 54, 123, 113, 120, 165, 110, 114, 75, 105, 90, 110)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 110, 106, 93, 54, 123, 111, 120, 165, 110, 114, 87, 163, 44, 112)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 35, 110, 88, 71, 45, 107, 90, 120, 165, 110, 93, 100, 144, 76, 89)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 86, 125, 95, 110, 90, 120, 165, 90, 94, 107, 146, 76, 87)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 86, 113, 37, 156, 88, 120, 165, 90, 94, 107, 146, 77, 89)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 35, 90, 107, 100, 56, 124, 111, 120, 165, 90, 112, 129, 155, 93, 110)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 110, 106, 95, 54, 123, 113, 120, 165, 110, 114, 75, 105, 90, 110)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 110, 106, 93, 54, 123, 111, 120, 165, 110, 114, 87, 163, 44, 112)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 35, 110, 88, 71, 45, 107, 90, 120, 165, 110, 93, 100, 144, 76, 89)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 86, 125, 95, 110, 90, 120, 165, 90, 94, 107, 146, 76, 87)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 86, 113, 37, 156, 88, 120, 165, 90, 94, 107, 146, 77, 89)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 35, 90, 107, 100, 56, 124, 111, 120, 165, 90, 112, 129, 155, 93, 110)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 110, 106, 95, 54, 123, 113, 120, 165, 110, 114, 75, 105, 90, 110)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 110, 106, 93, 54, 123, 111, 120, 165, 110, 114, 87, 163, 44, 112)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 35, 110, 88, 71, 45, 107, 90, 120, 165, 110, 93, 100, 144, 76, 89)',
    'MOTOwait()',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 35, 90, 86, 110, 95, 100, 90, 120, 165, 90, 94, 107, 146, 77, 89)',
    'MOTOwait()',
    'MOTOsetspeed(20)',
    'MOTOmove16(80, 35, 100, 90, 91, 48, 129, 88, 120, 165, 100, 94, 107, 146, 76, 89)',
    'MOTOwait()',
    'MOTOsetspeed(10)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Take_three_slow_steps_forward'] = function (block) {
  var code = "base_action.action('" + Blockly.Msg['TAKE_THREE_SLOW_STEPS_FORWARD'] + "')\n";
  return code;
}

Blockly.Blocks['1709710640564'] = {
  init: function() {
    this.jsonInit({
      "type": "1709710640564",
      "message0": "配送前进",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709710640564'] = function(block) {
  let code = "MOTOrigid16(30,30,30,65,75,80,75,65,30,30,30,65,75,80,75,65)\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,100,93,55,124,100,125,190,20,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(75,10,180,90,91,48,129,88,125,190,20,94,107,146,76,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,86,125,95,110,90,125,190,20,94,107,146,76,87,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,86,113,37,156,88,125,190,20,94,107,146,77,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(75,10,180,107,100,56,124,111,125,190,20,112,129,155,93,110,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,106,95,54,123,113,125,190,20,114,75,105,90,110,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,106,93,54,123,111,125,190,20,114,87,163,44,112,0,0,100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(75,10,180,88,71,45,107,90,125,190,20,93,100,144,76,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,86,110,95,100,90,125,190,20,94,107,146,77,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(20)\nMOTOmove19(75,10,180,90,91,48,129,88,125,190,20,94,107,146,76,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(75,10,180,100,93,55,124,100,125,190,20,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709710640564'] = function(block) {
  let code = "base_action.action('配送前进')\n";
  return code;
}

Blockly.Blocks['Take_a_quick_step_forward'] = {
  init: function () {
    this.jsonInit({
      type: 'Take_a_quick_step_forward',
      message0: '%{BKY_TAKE_A_QUICK_STEP_FORWARD}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Take_a_quick_step_forward'] = function (block) {
  const code = [
    'MOTOrigid16(25,25,25,75,75,90,80,70,25,25,25,75,75,90,80,70)',
    'MOTOsetspeed(45)',
    'MOTOmove16(80, 30, 100, 99, 93, 54, 122, 90, 120, 170, 100, 98, 107, 146, 75, 95)',
    'MOTOwait()',
    'MOTOsetspeed(60)',
    'MOTOmove16(80, 30, 80, 99, 115, 99, 103, 100, 120, 170, 80, 101, 109, 134, 91, 94)',
    'MOTOwait()',
    'MOTOsetspeed(70)',
    'MOTOmove16(80, 30, 80, 99, 110, 74, 121, 100, 120, 170, 80, 101, 114, 137, 91, 100)',
    'MOTOwait()',
    'MOTOsetspeed(80)',
    'MOTOmove16(80, 30, 80, 99, 110, 61, 126, 104, 120, 170, 80, 101, 100, 127, 94, 100)',
    'MOTOwait()',
    'MOTOsetspeed(80)',
    'MOTOmove16(80, 30, 120, 99, 91, 66, 109, 102, 120, 170, 120, 101, 85, 101, 97, 100)',
    'MOTOwait()',
    'MOTOsetspeed(80)',
    'MOTOmove16(80, 30, 120, 99, 86, 63, 110, 100, 120, 170, 120, 101, 90, 126, 79, 100)',
    'MOTOwait()',
    'MOTOsetspeed(80)',
    'MOTOmove16(80, 30, 120, 99, 100, 73, 106, 100, 120, 170, 120, 101, 90, 139, 74, 94)',
    'MOTOwait()',
    'MOTOsetspeed(65)',
    'MOTOmove16(80, 30, 120, 96, 95, 70, 110, 100, 120, 170, 120, 102, 109, 146, 75, 96)',
    'MOTOwait()',
    'MOTOsetspeed(45)',
    'MOTOmove16(80, 30, 100, 99, 93, 54, 122, 90, 120, 170, 100, 98, 107, 146, 75, 95)',
    'MOTOwait()',
    'MOTOsetspeed(15)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Take_a_quick_step_forward'] = function (block) {
  var code = "base_action.action('" + Blockly.Msg['TAKE_A_QUICK_STEP_FORWARD'] + "')\n";
  return code;
}

Blockly.Blocks['1709711386132'] = {
  init: function() {
    this.jsonInit({
      "type": "1709711386132",
      "message0": "配送前进三步",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709711386132'] = function(block) {
  let code = "MOTOrigid16(30,30,30,65,75,80,75,65,30,30,30,65,75,80,75,65)\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,100,93,55,124,100,125,190,20,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(75,10,180,90,91,48,129,88,125,190,20,94,107,146,76,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,86,125,95,110,90,125,190,20,94,107,146,76,87,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,86,113,37,156,88,125,190,20,94,107,146,77,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(75,10,180,107,100,56,124,111,125,190,20,112,129,155,93,110,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,106,95,54,123,113,125,190,20,114,75,105,90,110,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,106,93,54,123,111,125,190,20,114,87,163,44,112,0,0,100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(75,10,180,88,71,45,107,90,125,190,20,93,100,144,76,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,86,125,95,110,90,125,190,20,94,107,146,76,87,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,86,113,37,156,88,125,190,20,94,107,146,77,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(75,10,180,107,100,56,124,111,125,190,20,112,129,155,93,110,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,106,95,54,123,113,125,190,20,114,75,105,90,110,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,106,93,54,123,111,125,190,20,114,87,163,44,112,0,0,100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(75,10,180,88,71,45,107,90,125,190,20,93,100,144,76,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,86,125,95,110,90,125,190,20,94,107,146,76,87,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,86,113,37,156,88,125,190,20,94,107,146,77,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(75,10,180,107,100,56,124,111,125,190,20,112,129,155,93,110,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,106,95,54,123,113,125,190,20,114,75,105,90,110,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,106,93,54,123,111,125,190,20,114,87,163,44,112,0,0,100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(75,10,180,88,71,45,107,90,125,190,20,93,100,144,76,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,86,110,95,100,90,125,190,20,94,107,146,77,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(20)\nMOTOmove19(75,10,180,90,91,48,129,88,125,190,20,94,107,146,76,89,0,0,100)\nMOTOwait()\nMOTOsetspeed(10)\nMOTOmove19(75,10,180,100,93,55,124,100,125,190,20,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709711386132'] = function(block) {
  let code = "base_action.action('配送前进三步')\n";
  return code;
}

Blockly.Blocks['1709712869679'] = {
  init: function() {
    this.jsonInit({
      "type": "1709712869679",
      "message0": "配送释放",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709712869679'] = function(block) {
  let code = "MOTOrigid16(30,30,30,65,75,80,75,65,30,30,30,65,75,80,75,65)\nMOTOsetspeed(10)\nMOTOmove19(100,10,180,100,93,55,124,100,100,190,20,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(80,30,100,100,93,55,124,100,120,170,100,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709712869679'] = function(block) {
  let code = "base_action.action('配送释放')\n";
  return code;
}

Blockly.Blocks['1709713239364'] = {
  init: function() {
    this.jsonInit({
      "type": "1709713239364",
      "message0": "tmp",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709713239364'] = function(block) {
  let code = "MOTOrigid16(30,30,30,65,75,80,75,65,30,30,30,65,75,80,75,65)\nMOTOsetspeed(10)\nMOTOmove19(100,100,180,100,93,55,124,100,100,100,20,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(80,30,100,100,93,55,124,100,120,170,100,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709713239364'] = function(block) {
  let code = "base_action.action('tmp')\n";
  return code;
}

Blockly.Blocks['1709713460357'] = {
  init: function() {
    this.jsonInit({
      "type": "1709713460357",
      "message0": "配送释放",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1709713460357'] = function(block) {
  let code = "MOTOrigid16(30,30,30,65,75,80,75,65,30,30,30,65,75,80,75,65)\nMOTOsetspeed(100)\nMOTOmove19(75,10,180,100,93,55,124,100,125,190,20,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOsetspeed(100)\nMOTOmove19(100,100,180,100,93,55,124,100,100,100,20,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOsetspeed(100)\nMOTOmove19(100,100,100,100,93,55,124,100,100,100,100,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(80,30,100,100,93,55,124,100,120,170,100,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1709713460357'] = function(block) {
  let code = "base_action.action('配送释放')\n";
  return code;
}

Blockly.Blocks['Hail'] = {
  init: function () {
    this.jsonInit({
      type: 'Hail',
      message0: '%{BKY_HAIL}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Hail'] = function (block) {
  const code = [
    'MOTOrigid16(25,25,25,60,60,60,60,60,25,25,25,60,60,60,60,60)',
    'MOTOsetspeed(52)',
    'MOTOmove16(115, 180, 100, 99, 92, 59, 121, 100, 85, 20, 100, 99, 109, 144, 78, 100)',
    'MOTOwait()',
    'MOTOsetspeed(35)',
    'MOTOmove16(100, 145, 100, 99, 92, 59, 121, 100, 100, 55, 100, 99, 109, 144, 78, 100)',
    'MOTOwait()',
    'MOTOsetspeed(35)',
    'MOTOmove16(115, 180, 100, 99, 92, 59, 121, 100, 85, 20, 100, 99, 109, 144, 78, 100)',
    'MOTOwait()',
    'MOTOsetspeed(35)',
    'MOTOmove16(100, 145, 100, 99, 92, 59, 121, 100, 100, 55, 100, 99, 109, 144, 78, 100)',
    'MOTOwait()',
    'MOTOsetspeed(35)',
    'MOTOmove16(115, 180, 100, 99, 92, 59, 121, 100, 85, 20, 100, 99, 109, 144, 78, 100)',
    'MOTOwait()',
    'DelayMs(200)',
    'MOTOsetspeed(35)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Hail'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['HAIL'] + "')\n";
  return code;
}

Blockly.Blocks['loop'] = {
  init: function () {
    this.jsonInit({
      type: 'loop',
      message0: '%{BKY_EXIT_LOOP_TEXT}',
      previousStatement: null,
      nextStatement: null,
      colour: '#86C113',
      tooltip: '',
      helpUrl: '',
      extensions: ['controls_flow_in_loop_check'],
    });
  }
};

Blockly.Lua['loop'] = undefined

Blockly.Python['loop'] = function (block) {
  const code = 'break\n';
  return code;
}

Blockly.Blocks['remote_control_button'] = {
  init: function () {
    this.jsonInit({
      type: 'remote_control_button',
      message0: '%{BKY_REMOTE_CONTROL_BUTTON_REMOTE}， %1 ，%{BKY_REMOTE_CONTROL_BUTTON_KEY} %2',
      args0: [
        { type: 'field_dropdown', name: 'mode', options: remoteControlMode() },
        { type: 'field_dropdown', name: 'key', options: remoteControlKey },
      ],
      output: 'Remote_type',
      colour: Blockly.Msg.ControlHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['remote_control_button'] = undefined

Blockly.Python['remote_control_button'] = function (block) {
  const mode = block.getFieldValue('mode');
  const key = block.getFieldValue('key');
  const num = HKEYMap[mode][key];
  return [num, 0 > num ? Blockly.Python.ORDER_UNARY_SIGN : Blockly.Python.ORDER_ATOMIC];
}

Blockly.Blocks['remote_control'] = {
  init: function () {
    this.jsonInit({
      type: 'remote_control',
      message0: '%{BKY_GAMEPAD} %1 %{BKY_GAMEPAD_VAR} %2',
      args0: [
        {
          type: 'input_dummy',
        },
        {
          type: 'input_value',
          name: 'variable',
          check: 'Variable',
        },
      ],
      previousStatement: null,
      nextStatement: null,
      colour: Blockly.Msg.ControlHUE,
      tooltip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['remote_control'] = undefined

Blockly.Python['remote_control'] = function (block) {
  const variable = Blockly.Python.valueToCode(block, 'variable', Blockly.Python.ORDER_NONE);
  const code = variable ? `${variable} = get_key.key()\n` : `get_key.key()\n`;
  return code;
}

Blockly.Blocks['Stand_up'] = {
  init: function () {
    this.jsonInit({
      type: 'Stand_up',
      message0: '%{BKY_STAND_UP}',
      previousStatement: null,
      nextStatement: null,
      colour: '#48BCBC',
      toolip: '',
      helpUrl: '',
    });
  }
};

Blockly.Lua['Stand_up'] = function (block) {
  const code = [
    'MOTOrigid16(60,60,60,60,60,60,60,60,60,60,60,60,60,60,60,60)',
    'MOTOsetspeed(30)',
    'MOTOmove16(80, 30, 100, 100, 93, 55, 124, 100, 120, 170, 100, 100, 107, 145, 76, 100)',
    'MOTOwait()',
    '',
  ];
  return code.join('\n');
}

Blockly.Python['Stand_up'] = function (block) {
  let code = "base_action.action('" + Blockly.Msg['STAND_UP'] + "')\n";
  return code;
}

Blockly.Blocks['1711698495971'] = {
  init: function() {
    this.jsonInit({
      "type": "1711698495971",
      "message0": "拿左转",
      "previousStatement": null,
      "nextStatement": null,
      "colour": "#EDC611",
      "toolip": "",
      "helpUrl": ""
    });
  }
};

Blockly.Lua['1711698495971'] = function(block) {
  let code = "MOTOrigid16(30,30,30,65,65,65,65,65,125,30,30,65,65,65,65,65)\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,100,93,55,124,100,125,190,20,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOsetspeed(24)\nMOTOmove19(75,10,180,95,63,55,94,95,125,190,20,105,77,145,46,105,0,0,100)\nMOTOwait()\nMOTOsetspeed(24)\nMOTOmove19(75,10,180,100,93,55,124,100,125,190,20,100,107,145,76,100,0,0,100)\nMOTOwait()\nMOTOsetspeed(30)\nMOTOmove19(75,10,180,100,93,55,124,100,125,190,20,100,107,145,76,100,0,0,100)\nMOTOwait()\n";
  return code;
}

Blockly.Python['1711698495971'] = function(block) {
  let code = "base_action.action('拿左转')\n";
  return code;
}

